@networkbase/cli 1.0.4 → 2.0.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -37
- package/bin/nb.mjs +69 -5390
- package/lib/api.mjs +163 -0
- package/lib/args.mjs +140 -0
- package/lib/commands/account.mjs +293 -0
- package/lib/commands/agent.mjs +169 -0
- package/lib/commands/ask.mjs +84 -0
- package/lib/commands/assignments.mjs +199 -0
- package/lib/commands/browse.mjs +140 -0
- package/lib/commands/docs.mjs +178 -0
- package/lib/commands/extras.mjs +114 -0
- package/lib/commands/files.mjs +425 -0
- package/lib/commands/inbox.mjs +98 -0
- package/lib/commands/link.mjs +85 -0
- package/lib/commands/mcp.mjs +149 -0
- package/lib/commands/misc.mjs +263 -0
- package/lib/commands/resolve.mjs +95 -0
- package/lib/commands/table.mjs +225 -0
- package/lib/commands/tasks.mjs +362 -0
- package/lib/commands/undo.mjs +52 -0
- package/lib/commands/watch.mjs +113 -0
- package/lib/commands/work.mjs +190 -0
- package/lib/config.mjs +203 -0
- package/lib/context.mjs +72 -0
- package/lib/errors.mjs +72 -0
- package/lib/keychain.mjs +59 -0
- package/lib/mcp/tools.mjs +336 -0
- package/lib/print/notices.mjs +48 -0
- package/lib/print/out.mjs +151 -0
- package/lib/print/remind.mjs +25 -0
- package/lib/print/style.mjs +110 -0
- package/lib/sync/diff.mjs +41 -0
- package/lib/sync/ignore.mjs +86 -0
- package/lib/sync/local.mjs +68 -0
- package/lib/sync/plan.mjs +94 -0
- package/lib/sync/queue.mjs +31 -0
- package/lib/sync/state.mjs +136 -0
- package/lib/sync/transfer.mjs +172 -0
- package/lib/tui/ask.mjs +124 -0
- package/lib/undo-log.mjs +34 -0
- package/package.json +13 -11
package/README.md
CHANGED
|
@@ -1,55 +1,78 @@
|
|
|
1
|
-
# @networkbase/cli
|
|
1
|
+
# @networkbase/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
NetworkBase in your terminal: link a folder to a workspace, push and pull files, work on tasks, edit docs.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Run instantly without global installation:
|
|
5
|
+
Needs Node.js 20 or newer. No other dependencies.
|
|
8
6
|
|
|
9
7
|
```bash
|
|
10
|
-
npx @networkbase/cli
|
|
8
|
+
npx @networkbase/cli login
|
|
9
|
+
npx @networkbase/cli init design-lab
|
|
11
10
|
```
|
|
12
11
|
|
|
13
|
-
Or install
|
|
12
|
+
Or install it once and use `nb`:
|
|
14
13
|
|
|
15
14
|
```bash
|
|
16
15
|
npm install -g @networkbase/cli
|
|
17
|
-
nb init
|
|
18
16
|
```
|
|
19
17
|
|
|
20
|
-
##
|
|
18
|
+
## A first session
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
```bash
|
|
21
|
+
nb login # opens the browser; over SSH it shows a code to approve at networkbase.in/device
|
|
22
|
+
nb init design-lab # link this folder (asks which workspace if you leave it out)
|
|
23
|
+
nb pull # get the files
|
|
24
|
+
nb task start 4 # this folder works on task 4; moves it to In progress
|
|
25
|
+
nb push notes.md # same path = new version; never deletes anything
|
|
26
|
+
nb task done 4 -m "Login works" --check "npm test=pass"
|
|
27
|
+
```
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
`nb push` uploads only the files you name (or `--all` for every tracked file that changed). It never changes a task's status; `nb task start`, `nb task move` and `nb task done` do, and say so.
|
|
30
|
+
|
|
31
|
+
## Your edits are safe
|
|
32
|
+
|
|
33
|
+
- `nb pull` never overwrites a file you changed. If you and the server both changed it, you get a conflict copy (`report.remote-v4.md`) and `nb resolve`.
|
|
34
|
+
- `nb push` refuses when someone pushed a newer version since your last pull, and tells you to pull first.
|
|
35
|
+
- `nb diff` works offline against the version you last pulled. A push made offline waits in a queue until `nb sync`.
|
|
36
|
+
- Tokens are tied to the server that issued them; a project file can't send your token somewhere else.
|
|
37
|
+
|
|
38
|
+
## Scripts and agents
|
|
39
|
+
|
|
40
|
+
- `--json` prints one result on stdout: `{ "ok": true, "schema": "nb.task.list/1", "data": … }`. Errors go to stderr.
|
|
41
|
+
- Exit codes: 0 done, 1 failed, 2 usage, 3 sign-in or access, 4 conflict, 5 blocked (secret found, plan limit, read-only), 6 needs an answer, 7 needs a yes, 8 offline, 130 cancelled.
|
|
42
|
+
- Never asks a question when not in a terminal: pass `--answer key=value` or `--yes`, or read the question from exit code 6.
|
|
43
|
+
- `nb task view 4 --context` prints a brief for an AI agent, with people's text marked as data, not instructions.
|
|
44
|
+
- `NETWORKBASE_TOKEN` signs in without a file; `NB_HOME` moves the settings folder.
|
|
45
|
+
|
|
46
|
+
## AI agents
|
|
29
47
|
|
|
30
48
|
```bash
|
|
31
|
-
#
|
|
32
|
-
nb init # Interactive setup & workspace linker
|
|
33
|
-
nb auth login # Browser PKCE login or token login
|
|
34
|
-
nb auth status # Check current user and linked workspace
|
|
35
|
-
|
|
36
|
-
# Workspaces & Tasks
|
|
37
|
-
nb workspace list # List all accessible workspaces
|
|
38
|
-
nb task # View active tasks, subtasks & attached files
|
|
39
|
-
nb task 4 # View complete briefing for task #4
|
|
40
|
-
nb task work 4 # Bind task #4 and auto-mirror its attached files
|
|
41
|
-
nb task check # Interactive checklist to toggle subtasks
|
|
42
|
-
|
|
43
|
-
# Files & Sync
|
|
44
|
-
nb sync # Fast-path pull & push synchronization
|
|
45
|
-
nb push [file] # Push changes with sub-second finalization
|
|
46
|
-
nb push [file] --deliverable # Push final deliverable and link to task
|
|
47
|
-
nb watch # Watch local mirror and auto-push changes
|
|
48
|
-
|
|
49
|
-
# AI Integrations
|
|
50
|
-
nb mcp # Start Model Context Protocol server
|
|
49
|
+
nb agent setup claude # or codex, cursor: shows the change and asks first
|
|
51
50
|
```
|
|
52
51
|
|
|
53
|
-
|
|
52
|
+
Then ask Claude Code (or Codex, Cursor) things like "how many tasks do I have", "create a task to update the logo" or "change the README to add install steps". The agent signs in with its own token that only reaches the folder's linked workspace, and its changes show "via Claude Code" in the app. Finishing a task, final files, deleting and changing someone else's task wait for your yes; task text and files are passed to the agent as data, not instructions. When it's unsure, it asks you in the app (`nb ask`). `nb undo --session` reverses what one agent session did.
|
|
53
|
+
|
|
54
|
+
## Commands
|
|
55
|
+
|
|
56
|
+
Run `nb help` for the list and `nb help <command>` for flags and examples.
|
|
57
|
+
|
|
58
|
+
| Area | Commands |
|
|
59
|
+
|---|---|
|
|
60
|
+
| Account | `login`, `logout`, `whoami`, `token list/revoke`, `doctor`, `version`, `config`, `completion`, `setup shell`, `feedback`, `undo` |
|
|
61
|
+
| Folder | `init`, `unlink`, `status`, `open`, `activity` |
|
|
62
|
+
| Files | `pull`, `push`, `sync`, `diff`, `resolve`, `watch`, `file list/view/history/move/rename/delete/attach/detach` |
|
|
63
|
+
| Tasks | `task list/count/view/create/edit/assign/start/stop/move/done/report/review/resubmit/delete/open/pull`, `subtask list/add/check/uncheck/edit/delete/move`, `comment list/add/resolve`, `sprint list/view` |
|
|
64
|
+
| Docs | `doc list/view/edit/set`, `workspace list/view/open`, `member list`, `search`, `update post` |
|
|
65
|
+
| Agents | `agent setup/status/remove`, `mcp`, `ask` |
|
|
66
|
+
| Classes | `assignment list/view/pull/hand-in/question`, `review list/view/approve/return/pull` |
|
|
67
|
+
| Inbox | `inbox [--unread] [--follow --notify]`, `inbox read/open` |
|
|
68
|
+
|
|
69
|
+
## Coming from 1.x
|
|
70
|
+
|
|
71
|
+
- The background auto-push process is gone. `nb init` stops it and moves `.networkbase/mirror` to `.networkbase/legacy-mirror` (never deleted). `nb watch` runs in the foreground instead.
|
|
72
|
+
- `push --done`, `--wip` and `sync --done` no longer change status; use `nb task done` / `nb task move`.
|
|
73
|
+
- `nb hook install` and the git credential commands were removed.
|
|
74
|
+
- Old command names (`task work`, `task check`, …) still work in 2.x and print the new name once a day.
|
|
75
|
+
|
|
76
|
+
## Security
|
|
54
77
|
|
|
55
|
-
|
|
78
|
+
Report problems to support@networkbase.in (see SECURITY.md in the repository). The CLI sends no telemetry.
|