@networkbase/cli 1.0.3 → 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 CHANGED
@@ -1,55 +1,78 @@
1
- # @networkbase/cli (`nb`)
1
+ # @networkbase/cli
2
2
 
3
- The official command-line interface, local workspace mirror, Git credential helper, and Model Context Protocol (MCP) server for [NetworkBase](https://networkbase.in).
3
+ NetworkBase in your terminal: link a folder to a workspace, push and pull files, work on tasks, edit docs.
4
4
 
5
- ## Quick Start
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 init
8
+ npx @networkbase/cli login
9
+ npx @networkbase/cli init design-lab
11
10
  ```
12
11
 
13
- Or install globally:
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
- ## Key Capabilities
18
+ ## A first session
21
19
 
22
- - **Interactive Command Palette & Auth:** 1-click browser PKCE authorization with arrow-key navigation, terminal fuzzy search, and automatic Personal Access Token (PAT) lifecycle.
23
- - **Sub-Second Fast-Push (1-RTT):** SHA-256 deduplicated, parallelized pushes with `HTTP 304` ETag fast-path.
24
- - **Local Mirror & Background Daemon:** Zero-prompt local mirror (`.networkbase/mirror/`) with background auto-sync (`nb watch --daemon-worker`) for seamless pair programming with Claude Code, Cursor, and Antigravity.
25
- - **Task Intelligence & Context Engine:** Real-time task dashboard (`nb task`), task-number binding (`nb task work #4`), interactive subtask checklists (`nb task check`), and live zero-prompt task briefings (`.networkbase/tasks/TASKS.md`).
26
- - **AI MCP Server:** Plug directly into Cursor, Claude Desktop, or Antigravity via `nb mcp` or stdio transport.
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
- ## Commands
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
- # Setup & Authentication
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
- ## Documentation
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
- Full documentation is available at [networkbase.in](https://networkbase.in).
78
+ Report problems to support@networkbase.in (see SECURITY.md in the repository). The CLI sends no telemetry.