botrun-msync
Advanced tools
+1
-1
| { | ||
| "name": "botrun-msync", | ||
| "version": "0.1.0", | ||
| "version": "0.2.0", | ||
| "description": "Git-backed memory sync CLI for AI agents (forked from botrun-mcli@0.2.2)", | ||
@@ -5,0 +5,0 @@ "type": "module", |
+23
-23
@@ -42,3 +42,3 @@ # botrun-msync — Git-backed Memory Sync CLI for Agents | ||
| --repo github.com/org/my-memory \ | ||
| --token-env BM_TOKEN_NOTES \ | ||
| --token-env BMS_TOKEN_NOTES \ | ||
| --description "Personal research notes" \ | ||
@@ -57,3 +57,3 @@ --access readwrite | ||
| --repo github.com/org/director-memory \ | ||
| --token-env BM_TOKEN_DIRECTOR \ | ||
| --token-env BMS_TOKEN_DIRECTOR \ | ||
| --description "Director personal research" \ | ||
@@ -65,3 +65,3 @@ --access readwrite | ||
| --repo github.com/org/team1-memory \ | ||
| --token-env BM_TOKEN_TEAMS \ | ||
| --token-env BMS_TOKEN_TEAMS \ | ||
| --description "Team 1 memory" \ | ||
@@ -72,3 +72,3 @@ --access readonly | ||
| --repo github.com/org/team2-memory \ | ||
| --token-env BM_TOKEN_TEAMS \ | ||
| --token-env BMS_TOKEN_TEAMS \ | ||
| --description "Team 2 memory" \ | ||
@@ -79,4 +79,4 @@ --access readonly | ||
| Create separate GitHub Fine-grained PATs with different permissions: | ||
| - `BM_TOKEN_DIRECTOR` → Contents: Read and write (only `director-memory` repo) | ||
| - `BM_TOKEN_TEAMS` → Contents: Read-only (only `team1-memory` + `team2-memory` repos) | ||
| - `BMS_TOKEN_DIRECTOR` → Contents: Read and write (only `director-memory` repo) | ||
| - `BMS_TOKEN_TEAMS` → Contents: Read-only (only `team1-memory` + `team2-memory` repos) | ||
@@ -92,3 +92,3 @@ This way, even if a user modifies the config, they can't write to repos their token doesn't allow. | ||
| ``` | ||
| ~/.botrun/bm/ ← default base path | ||
| ~/.botrun/bms/ ← default base path | ||
| ├── config.json ← scope definitions | ||
@@ -104,13 +104,13 @@ └── data/ | ||
| ```bash | ||
| npx botrun-msync --bm-path /tmp/test-bm memory init # CLI option (highest priority) | ||
| BM_PATH=/custom/path npx botrun-msync memory init # environment variable | ||
| npx botrun-msync --bms-path /tmp/test-bms memory init # CLI option (highest priority) | ||
| BMS_PATH=/custom/path npx botrun-msync memory init # environment variable | ||
| ``` | ||
| Priority: `--bm-path` > `BM_PATH` > `~/.botrun/bm/` | ||
| Priority: `--bms-path` > `BMS_PATH` > `~/.botrun/bms/` | ||
| ### Config File | ||
| Located at `<BM_PATH>/config.json` (default: `~/.botrun/bm/config.json`). | ||
| Located at `<BMS_PATH>/config.json` (default: `~/.botrun/bms/config.json`). | ||
| Override config path independently with: `BM_CONFIG=/path/to/config.json` | ||
| Override config path independently with: `BMS_CONFIG=/path/to/config.json` | ||
@@ -122,3 +122,3 @@ ```json | ||
| "repo": "github.com/org/member1-memory", | ||
| "token_env": "BM_TOKEN_NOTES", | ||
| "token_env": "BMS_TOKEN_NOTES", | ||
| "description": "Personal research notes", | ||
@@ -130,3 +130,3 @@ "access": "readwrite" | ||
| "branch": "dev", | ||
| "token_env": "BM_TOKEN_TEAMS", | ||
| "token_env": "BMS_TOKEN_TEAMS", | ||
| "description": "Team 1 memory", | ||
@@ -160,4 +160,4 @@ "access": "readonly" | ||
| |----------|---------| | ||
| | `BM_PATH` | Base directory for all bm data (default: `~/.botrun/bm`) | | ||
| | `BM_CONFIG` | Config file path (overrides `<BM_PATH>/config.json`) | | ||
| | `BMS_PATH` | Base directory for all bms data (default: `~/.botrun/bms`) | | ||
| | `BMS_CONFIG` | Config file path (overrides `<BMS_PATH>/config.json`) | | ||
@@ -170,3 +170,3 @@ Each scope's token is configured via `--token-env`, which points to an environment variable name. There are no global token variables — every scope must declare its own. | ||
| Clones all configured scope repos to `<BM_PATH>/data/<scope-name>/`. If already cloned, pulls latest. | ||
| Clones all configured scope repos to `<BMS_PATH>/data/<scope-name>/`. If already cloned, pulls latest. | ||
@@ -176,4 +176,4 @@ ```json | ||
| "scopes": { | ||
| "my-notes": { "local": "/root/.botrun/bm/data/my-notes" }, | ||
| "team1": { "local": "/root/.botrun/bm/data/team1" } | ||
| "my-notes": { "local": "/root/.botrun/bms/data/my-notes" }, | ||
| "team1": { "local": "/root/.botrun/bms/data/team1" } | ||
| } | ||
@@ -194,3 +194,3 @@ } | ||
| "access": "readwrite", | ||
| "local": "/root/.botrun/bm/data/my-notes" | ||
| "local": "/root/.botrun/bms/data/my-notes" | ||
| }, | ||
@@ -201,3 +201,3 @@ "team1": { | ||
| "access": "readonly", | ||
| "local": "/root/.botrun/bm/data/team1" | ||
| "local": "/root/.botrun/bms/data/team1" | ||
| } | ||
@@ -233,3 +233,3 @@ } | ||
| VM starts | ||
| → npx botrun-msync memory init # clone repos to <BM_PATH>/data/ | ||
| → npx botrun-msync memory init # clone repos to <BMS_PATH>/data/ | ||
| → agent reads/writes files # using native tools (Read, Write, grep) | ||
@@ -244,3 +244,3 @@ → npx botrun-msync memory sync # push changes | ||
| npm install | ||
| npm test # 41 tests | ||
| npm test | ||
| ``` | ||
@@ -247,0 +247,0 @@ |
+4
-4
@@ -30,9 +30,9 @@ #!/usr/bin/env node | ||
| .description('Git-backed memory sync for agents') | ||
| .version('0.1.0') | ||
| .version('0.2.0') | ||
| .helpCommand(false) | ||
| .option('--bm-path <path>', 'Base directory for all bm data') | ||
| .option('--bms-path <path>', 'Base directory for all bms data') | ||
| .configureHelp({ formatHelp: (cmd) => JSON.stringify(jsonHelp(cmd), null, 2) }) | ||
| .hook('preAction', (thisCommand) => { | ||
| const bmPath = thisCommand.opts().bmPath; | ||
| if (bmPath) process.env.BM_PATH = bmPath; | ||
| const bmsPath = thisCommand.opts().bmsPath; | ||
| if (bmsPath) process.env.BMS_PATH = bmsPath; | ||
| }); | ||
@@ -39,0 +39,0 @@ |
@@ -40,3 +40,3 @@ import { join } from 'node:path'; | ||
| await gitExec(['-C', cloneDir, 'add', '-A']); | ||
| await gitExec(['-C', cloneDir, 'commit', '-m', `bm: update ${name} memories`]); | ||
| await gitExec(['-C', cloneDir, 'commit', '-m', `bms: update ${name} memories`]); | ||
| await gitExec(['-C', cloneDir, 'push']); | ||
@@ -43,0 +43,0 @@ didPush = true; |
+3
-3
@@ -5,10 +5,10 @@ import { readFile, writeFile, mkdir } from 'node:fs/promises'; | ||
| const DEFAULT_BASE_PATH = join(homedir(), '.botrun', 'bm'); | ||
| const DEFAULT_BASE_PATH = join(homedir(), '.botrun', 'bms'); | ||
| export function getBasePath() { | ||
| return process.env.BM_PATH || DEFAULT_BASE_PATH; | ||
| return process.env.BMS_PATH || DEFAULT_BASE_PATH; | ||
| } | ||
| export function getConfigPath() { | ||
| return process.env.BM_CONFIG || join(getBasePath(), 'config.json'); | ||
| return process.env.BMS_CONFIG || join(getBasePath(), 'config.json'); | ||
| } | ||
@@ -15,0 +15,0 @@ |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
18421
0.12%