@codesummary/cli 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/README.md +119 -166
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,280 +1,233 @@
1
1
  # CodeSummary CLI
2
2
 
3
- Dependency-free Node CLI for submitting a local workspace to CodeSummary.
4
- The hosted flow can log in with OAuth, create or link a private docs site,
5
- upload a local source snapshot, and start knowledge updates from the repo
6
- directory.
3
+ Submit a local codebase to CodeSummary, generate or update hosted knowledge,
4
+ and optionally run documentation generation locally with your own provider.
7
5
 
8
6
  ## Install
9
7
 
10
- Before npm publication, install from the private GitHub repo:
11
-
12
8
  ```bash
13
- npm install -g github:CodeSummaryAI/codesummary-cli
9
+ npm install -g @codesummary/cli
14
10
  ```
15
11
 
16
- After npm publication:
12
+ Verify the install:
17
13
 
18
14
  ```bash
19
- npm install -g @codesummary/cli
15
+ codesummary --version
20
16
  ```
21
17
 
22
- Then run it from a repo:
18
+ ## Quickstart
19
+
20
+ Run these commands from the repository you want CodeSummary to understand:
23
21
 
24
22
  ```bash
25
- codesummary login --api-url https://dashboard.codesummary.io
23
+ codesummary login
26
24
  codesummary
27
25
  ```
28
26
 
29
- Bare `codesummary` is the normal workflow. It inspects the current repo and
30
- guides the user through creating or updating the CodeSummary knowledge source.
27
+ The interactive `codesummary` command detects the current workspace, signs in
28
+ with your CodeSummary account, creates or links a private docs site, uploads the
29
+ source snapshot, and starts the right knowledge job.
31
30
 
32
- ## Install Smoke
31
+ After the first run, use the same command to update knowledge:
32
+
33
+ ```bash
34
+ codesummary
35
+ ```
33
36
 
34
- From this repo, verify the packaged binary path before release:
37
+ ## Common Commands
35
38
 
36
39
  ```bash
37
- npm test
38
- npm run test:package
39
- npm run release:check
40
+ codesummary # interactive hosted workflow
41
+ codesummary login # sign in with CodeSummary OAuth
42
+ codesummary whoami # show current account/workspace state
43
+ codesummary status # show latest job status
44
+ codesummary status --wait # follow latest job until it finishes
45
+ codesummary diff # compare local files to last submitted manifest
46
+ codesummary manifest # write .codesummary/manifest.json
47
+ codesummary logout # remove local CLI auth for this workspace
40
48
  ```
41
49
 
42
- `test:package` runs `npm pack`, installs the tarball into a temporary project,
43
- and verifies that the installed `codesummary` binary starts correctly inside a
44
- repo workspace.
50
+ ## Initialize A Workspace
45
51
 
46
- ## Commands
52
+ Use `new` when you want to create or prepare a workspace before generating
53
+ knowledge:
47
54
 
48
55
  ```bash
49
- codesummary
50
- codesummary new ./my-service --api-url https://dashboard.codesummary.io
51
- codesummary login --api-url https://dashboard.codesummary.io
52
- codesummary config set apiUrl https://dashboard.codesummary.io
53
- codesummary config get apiUrl
54
- codesummary config clear apiUrl
55
- codesummary link --site-token <csp_token> --api-url https://dashboard.codesummary.io --name my-repo
56
- codesummary manifest
57
- codesummary diff
58
- codesummary export --output ./codesummary-export
59
- codesummary export --output s3://my-bucket/path --include-archive
60
- codesummary generate --provider codex --output ./docs
61
- codesummary generate --provider openai --api-key-env OPENAI_API_KEY --output ./docs
62
- codesummary configure --provider codex --output ./docs
63
- codesummary generate
64
- codesummary submit --depth standard
65
- codesummary status
66
- codesummary submit --depth standard --wait
67
- codesummary version
68
- codesummary update
56
+ codesummary new ./my-service
69
57
  ```
70
58
 
71
- Bare `codesummary` starts the interactive hosted workflow. It inspects the
72
- current directory, OAuth state, linked site, last submitted manifest, and local
73
- diff, then offers the right action:
59
+ For an existing repo:
74
60
 
75
- - fresh repo: create a private docs site and generate knowledge, or check setup without generation
76
- - existing repo with changes: update knowledge, check setup without generation, or show the diff
77
- - existing repo with no changes: refresh anyway, check setup without generation, or exit
61
+ ```bash
62
+ codesummary new --name my-service --force
63
+ ```
78
64
 
79
- `new` initializes a local CodeSummary workspace. It creates
80
- `.codesummary/config.json`, stores the source name/API URL, and never deletes
81
- existing files. If you point it at a non-empty directory, pass `--force` to
82
- confirm you want to initialize that directory in place.
65
+ `new` creates `.codesummary/config.json` and stores local defaults. It does not
66
+ delete source files, call CodeSummary hosted services, or start generation.
83
67
 
84
- `config` manages persistent workspace defaults:
68
+ ## Configuration
69
+
70
+ Workspace configuration lives in `.codesummary/config.json`.
85
71
 
86
72
  ```bash
87
73
  codesummary config list
74
+ codesummary config get apiUrl
88
75
  codesummary config set apiUrl https://dashboard.codesummary.io
89
76
  codesummary config set sourceName my-service
90
77
  codesummary config set depth standard
91
- codesummary config set localGeneration.provider codex
92
- codesummary config get sourceName
93
78
  codesummary config clear depth
94
79
  ```
95
80
 
96
- Supported keys are `apiUrl`, `sourceName`, `depth`, `site.id`, `site.slug`,
97
- `site.name`, `localGeneration.provider`, `localGeneration.output`,
98
- `localGeneration.model`, and `localGeneration.apiKeyEnv`.
99
-
100
- `link` verifies the token, records the existing site it belongs to, and stores
101
- local settings in `.codesummary/config.json`. It does not create a new hosted
102
- site. The token determines which existing site receives future draft knowledge
103
- updates.
104
-
105
- `submit` creates `.codesummary/manifest.json`, zips the current workspace, uploads it to
106
- `/api/cli/submit`, links the source to the token's existing site, and enqueues a knowledge job.
107
- The manifest is sent as separate metadata so CodeSummary can track file hashes
108
- without relying on the uploaded source archive.
109
- When the source is linked to an existing site, the backend also enqueues a site
110
- draft update after the repo knowledge job completes.
111
- `--no-generate` is a no-spend setup check: it stores manifest metadata and
112
- source/site linkage, but does not retain the uploaded source archive.
113
- The CLI stores the last submitted job id in `.codesummary/config.json`, so
114
- `codesummary status` can check it without passing `--job-id`. Status responses
115
- include both the repo job and the latest linked site job when a site update is
116
- running.
117
-
118
- After a successful submit, the CLI stores
119
- `.codesummary/last-submitted-manifest.json`. `codesummary diff` compares the
120
- current workspace against that baseline and reports added, changed, and removed
121
- files without uploading anything. Use `--against <manifest.json>` to compare
122
- against a specific baseline.
123
-
124
- `export` creates a local or S3 bundle without calling CodeSummary hosted
125
- infrastructure. By default it exports only manifest metadata and does not include
126
- source contents. Pass `--include-archive` only when writing to infrastructure you
127
- control.
128
-
129
- ## Auth
130
-
131
- Use OAuth for the normal developer workflow:
81
+ Supported keys:
82
+
83
+ - `apiUrl`
84
+ - `sourceName`
85
+ - `depth`
86
+ - `site.id`
87
+ - `site.slug`
88
+ - `site.name`
89
+ - `localGeneration.provider`
90
+ - `localGeneration.output`
91
+ - `localGeneration.model`
92
+ - `localGeneration.apiKeyEnv`
93
+
94
+ ## Hosted Knowledge Updates
95
+
96
+ Use the hosted workflow when you want CodeSummary to generate or update the
97
+ private draft for a docs site without committing generated files to your repo:
132
98
 
133
99
  ```bash
134
- codesummary login --api-url https://dashboard.codesummary.io
100
+ codesummary login
135
101
  codesummary
136
102
  ```
137
103
 
138
- Product/site tokens with `write:knowledge` or `write:all` scope are still
139
- supported for scripted or site-bound workflows.
104
+ The CLI uploads a filtered source snapshot and a manifest. CodeSummary uses the
105
+ snapshot to run the knowledge job, then tracks future changes with the manifest.
140
106
 
141
- ```bash
142
- export CODESUMMARY_API_KEY=csp_...
143
- export CODESUMMARY_API_URL=https://dashboard.codesummary.io
144
- codesummary link --site-token "$CODESUMMARY_API_KEY" --api-url "$CODESUMMARY_API_URL" --name my-repo
145
- codesummary submit --name my-repo --depth standard
146
- codesummary status --wait
147
- ```
107
+ The archive excludes common dependency, build, cache, and secret files:
108
+
109
+ - `.git`
110
+ - `node_modules`
111
+ - `.next`
112
+ - `dist`
113
+ - `build`
114
+ - `coverage`
115
+ - `.codesummary`
116
+ - `.env`
117
+ - `.env.*`
118
+ - `.npmrc`
119
+ - `.yarnrc`
148
120
 
149
- ## Existing Site Updates
121
+ Publishing the docs site is a separate dashboard action.
150
122
 
151
- The intended hosted workflow is:
123
+ ## Non-Interactive Submit
124
+
125
+ For scripts or CI-style usage:
152
126
 
153
127
  ```bash
154
- codesummary login --api-url https://dashboard.codesummary.io
155
- codesummary
128
+ codesummary submit --depth standard
129
+ codesummary status --wait
156
130
  ```
157
131
 
158
- The local directory becomes a CLI CodeSummary source linked to the selected or
159
- auto-created private site. Later runs update that same source and can enqueue a
160
- site draft update when the source knowledge job completes. Publishing the site
161
- is still a separate dashboard action.
132
+ To verify setup without starting generation:
162
133
 
163
- Use `--depth standard` for the default update path. The CLI defaults to
164
- `standard`; `deep` is available for a more expensive full-context pass.
165
-
166
- ## Defaults
134
+ ```bash
135
+ codesummary submit --no-generate
136
+ ```
167
137
 
168
- The archive excludes common build/cache folders and secret files:
138
+ Product or site tokens are supported for scripted workflows:
169
139
 
170
- - `.git`, `node_modules`, `.next`, `dist`, `build`, `coverage`
171
- - `.codesummary`, `.env`, `.env.*`, `.npmrc`, `.yarnrc`
140
+ ```bash
141
+ export CODESUMMARY_API_KEY=csp_...
142
+ export CODESUMMARY_API_URL=https://dashboard.codesummary.io
172
143
 
173
- The manifest stores file paths, sizes, mtimes, and SHA-256 hashes. It does not
174
- store file contents.
144
+ codesummary link --site-token "$CODESUMMARY_API_KEY" --name my-repo
145
+ codesummary submit --depth standard
146
+ codesummary status --wait
147
+ ```
175
148
 
176
- ## Local / BYO Output
149
+ ## Local Export
177
150
 
178
- For teams that do not want to upload source code to CodeSummary, export a bundle
179
- locally:
151
+ Export manifest metadata without calling CodeSummary hosted infrastructure:
180
152
 
181
153
  ```bash
182
154
  codesummary export --output ./codesummary-export
183
155
  ```
184
156
 
185
- The bundle contains:
157
+ The export includes:
186
158
 
187
159
  - `codesummary-manifest.json`
188
160
  - `codesummary-export.json`
189
161
  - `README.md`
190
162
 
191
- To include the excluded-source-filtered archive in your own storage, opt in:
163
+ To include a filtered source archive in storage you control:
192
164
 
193
165
  ```bash
194
166
  codesummary export --output s3://my-bucket/codesummary/my-repo --include-archive
195
167
  ```
196
168
 
197
- S3 output uses the local `aws s3 sync` command and your existing AWS credentials.
169
+ S3 output uses your local AWS credentials through `aws s3 sync`.
198
170
 
199
- ## Local Inference
171
+ ## Local Generation
200
172
 
201
- `generate` runs documentation inference locally. It does not upload source code
202
- or provider credentials to CodeSummary.
173
+ Run documentation generation locally when you do not want to upload source code
174
+ to CodeSummary hosted infrastructure.
203
175
 
204
- Use the local Codex subscription/session:
176
+ Use your local Codex CLI session:
205
177
 
206
178
  ```bash
207
179
  codesummary generate --provider codex --output ./docs
208
180
  ```
209
181
 
210
- Configure the workspace once, then omit flags:
182
+ Configure defaults once:
211
183
 
212
184
  ```bash
213
185
  codesummary configure --provider codex --output ./docs
214
186
  codesummary generate
215
187
  ```
216
188
 
217
- Bare `codesummary` is reserved for the hosted interactive workflow. Local
218
- inference remains explicit with `codesummary generate` so it never spends local
219
- provider credits by surprise.
220
-
221
- Use a provider API key from your local environment:
189
+ Use a local provider API key:
222
190
 
223
191
  ```bash
224
192
  export OPENAI_API_KEY=sk-...
225
193
  codesummary generate --provider openai --api-key-env OPENAI_API_KEY --output ./docs
226
- codesummary configure --provider openai --api-key-env OPENAI_API_KEY --output ./docs
227
194
 
228
195
  export ANTHROPIC_API_KEY=sk-ant-...
229
196
  codesummary generate --provider anthropic --api-key-env ANTHROPIC_API_KEY --output ./docs
230
- codesummary configure --provider anthropic --api-key-env ANTHROPIC_API_KEY --output ./docs
231
197
  ```
232
198
 
233
- Safe smoke test without inference:
199
+ Dry-run local packaging without inference:
234
200
 
235
201
  ```bash
236
- codesummary generate --provider mock --output ./docs
237
202
  codesummary generate --provider codex --output ./docs --dry-run
238
203
  ```
239
204
 
240
- Local generation creates `.codesummary/manifest.json`, builds a local context
241
- pack from non-secret text files, asks the selected local provider to return a
242
- strict JSON document set, validates the result, and writes Markdown files to the
243
- output directory.
244
-
245
- Security model:
205
+ Local generation does not send provider keys to CodeSummary. Provider keys stay
206
+ in your local environment, and `.codesummary/config.json` stores only the
207
+ provider name and environment variable name.
246
208
 
247
- - Provider keys stay in local environment variables.
248
- - `.codesummary/config.json` stores the provider choice and env var name, not the
249
- provider key value.
250
- - Codex mode uses the local Codex CLI/session; CodeSummary never sees that
251
- credential.
252
- - Source contents are sent only to the selected local provider.
253
- - CodeSummary hosted infrastructure is not called by `generate`.
254
- - Publishing or hosted site updates remain separate commands/flows.
209
+ ## Version And Updates
255
210
 
256
- ## Staging E2E
211
+ ```bash
212
+ codesummary version
213
+ codesummary update
214
+ ```
257
215
 
258
- For CodeSummary maintainers, the current no-spend staging hosted-flow check is:
216
+ `update` prints the npm command for upgrading the CLI:
259
217
 
260
218
  ```bash
261
- codesummary login --api-url https://dashboard-staging.codesummary.io
262
- codesummary whoami
263
- codesummary diff
264
- codesummary status
219
+ npm install -g @codesummary/cli@latest
265
220
  ```
266
221
 
267
- For package/local CLI regressions:
222
+ ## Maintainer Checks
223
+
224
+ Before releasing a new version:
268
225
 
269
226
  ```bash
270
227
  npm test
271
228
  npm run test:package
229
+ npm run release:check
272
230
  ```
273
231
 
274
- Staging defaults to mock generation, so a hosted generation run should complete
275
- without provider spend but will only produce deterministic test docs. Do not run
276
- provider-backed staging generation unless the operator explicitly approves the
277
- credit spend.
278
-
279
- The old `scripts/staging-e2e.sh` EC2/SSM flow is retired. Staging no longer has
280
- that backend EC2 shape.
232
+ `test:package` runs `npm pack`, installs the tarball into a temporary project,
233
+ and verifies that the installed `codesummary` binary starts correctly.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codesummary/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Submit local workspaces to CodeSummary knowledge and hosted docs.",
5
5
  "type": "module",
6
6
  "bin": {