@joripspace/cli 0.6.1 → 0.7.0

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,243 +1,286 @@
1
- # JoripSpace CLI
2
-
3
- **JoripSpace — Build and deploy web apps with AI agents. Powered by Cosmosfarm.**
4
-
5
- The official command-line client for JoripSpace. Connect a project, deploy your app, and manage its database, files, Secrets, and realtime services from your terminal or coding agent.
6
-
7
- The CLI runs on Windows, macOS, and Linux with **Node.js 18 or later and npm**. It runs directly in Node.js, so you do not need a TypeScript compiler or native build tools to install it.
8
-
9
- [Website](https://joripspace.com) · [Documentation](https://joripspace.com/en/docs/) · [CLI reference](https://joripspace.com/en/docs/cli/) · [GitHub](https://github.com/JoripSpace/joripspace-cli) · [Support](mailto:support@cosmosfarm.com)
10
-
11
- ## Install and update
12
-
13
- Install the CLI, then check the version your terminal runs:
14
-
15
- ```sh
16
- npm install -g @joripspace/cli@latest
17
- joripspace --version
18
- ```
19
-
20
- To update an existing installation, run the same install command again. Global installations do not update automatically. You can check the latest published version with:
1
+ # JoripSpace CLI
2
+
3
+ **JoripSpace — Build and deploy web apps with AI agents. Powered by Cosmosfarm.**
4
+
5
+ The official command-line client for JoripSpace. Connect a project, deploy your app, and manage its database, files, Secrets, and realtime services from your terminal or coding agent.
6
+
7
+ The CLI runs on Windows, macOS, and Linux with **Node.js 18 or later and npm**. It runs directly in Node.js, so you do not need a TypeScript compiler or native build tools to install it.
8
+
9
+ [Website](https://joripspace.com) · [Documentation](https://joripspace.com/en/docs/) · [CLI reference](https://joripspace.com/en/docs/cli/) · [GitHub](https://github.com/JoripSpace/joripspace-cli) · [Support](mailto:support@cosmosfarm.com)
10
+
11
+ ## Install and update
12
+
13
+ Install the CLI, then check the version your terminal runs:
14
+
15
+ ```sh
16
+ npm install -g @joripspace/cli@latest
17
+ joripspace --version
18
+ ```
19
+
20
+ To update an existing installation, run the same install command again. Global installations do not update automatically. You can check the latest published version with:
21
+
22
+ ```sh
23
+ npm view @joripspace/cli@latest version
24
+ ```
25
+
26
+ If the version stays the same after an update, your terminal may still be using an older installation. Check its location with `Get-Command joripspace -All` in PowerShell or `command -v joripspace` on macOS and Linux. For an npm installation, `npm root -g` shows the directory containing `@joripspace/cli/bin/joripspace.js`, which you can run with Node.
27
+
28
+ You can also run the CLI without a global installation:
29
+
30
+ ```sh
31
+ npx -y @joripspace/cli@latest --help
32
+ npx -y @joripspace/cli@latest start PROJECT --json
33
+ ```
34
+
35
+ This selects the latest published npm release. Replace `PROJECT` with your existing project name. Installing the package does not log you in or change your project settings.
36
+
37
+ ## Connect a project
38
+
39
+ Open your project folder and run:
40
+
41
+ ```sh
42
+ joripspace login
43
+ joripspace projects
44
+ joripspace start PROJECT --json
45
+ ```
46
+
47
+ Follow the link to [JoripSpace Connect](https://joripspace.com/connect/), approve the connection in your browser, and enter the one-time code within five minutes. You can then connect a project and continue from its current source and deployment state.
48
+
49
+ `start` connects an existing project. It also prepares the project instructions for your agent and synchronizes source files when required by the connection. To create a project first, see [Create a project](#create-a-project) below.
50
+
51
+ To work in another folder, add `--cwd`. Quote paths that contain spaces:
52
+
53
+ ```sh
54
+ joripspace start my-app --cwd "my project" --json
55
+ joripspace get --cwd "my project" --json
56
+ ```
57
+
58
+ Without `--cwd`, the CLI uses the current folder and searches its parent folders for a project connection. The connected project name is recorded in `.joripspace/project`.
59
+
60
+ ## Work with a coding agent
61
+
62
+ Use an agent that can run terminal commands, edit files, and access the network. You can send it this prompt after replacing `PROJECT` with your project name:
63
+
64
+ ```text
65
+ Help me get started with JoripSpace project "PROJECT".
66
+ 1. Install or update the official CLI with npm install -g @joripspace/cli@latest.
67
+ Compare the version that actually runs with the latest version on npm.
68
+ If an older executable is still selected, find and use the updated npm CLI.
69
+ 2. Run joripspace start PROJECT --json and read its onboarding guide
70
+ and the project instruction files to complete the connection.
71
+ 3. Review the existing project and explain the next steps for my task.
72
+ ```
73
+
74
+ If approval is needed, the response includes a connection link and commands to sign in and resume. After approving the connection, give your agent the five-minute code. It can pass the code without waiting for terminal input:
75
+
76
+ ```sh
77
+ joripspace login --code "CONNECTION_CODE" --json
78
+ joripspace start PROJECT --json
79
+ ```
80
+
81
+ The CLI connection works without a plugin or MCP setup. If you also use MCP, its client has a separate sign-in process. Reuse a saved CLI login or complete the CLI connection flow when switching between them. See the [MCP connection guide](https://joripspace.com/en/docs/mcp/) for client setup and tool details.
82
+
83
+ ### Project instructions
84
+
85
+ `start` returns a guide and writes it into a marked JoripSpace section in `AGENTS.md`. New files place `User instructions` first, followed by `JoripSpace managed instructions`. Existing user content is preserved, and `CLAUDE.md` keeps a reference to `AGENTS.md`.
86
+
87
+ Your agent can use the returned guide immediately. If it does not load project files automatically, ask it to read the listed files in the current conversation. No agent restart is needed for this workflow.
88
+
89
+ The guide explains how to find relevant CLI help, MCP tools, and task guidance as needed. You do not have to copy every command option into your project instructions. The [task workflows](https://joripspace.com/en/docs/agent-workflows/) show how to use these tools for deployment, database changes, service connections, and reports.
90
+
91
+ ## Repeatable app deployment
92
+
93
+ For a direct-deployment project, build the app and identify the bundled Worker entrypoint and assets.
94
+ For example, when the output is `dist/worker.js`, deploy the output directory:
21
95
 
22
96
  ```sh
23
- npm view @joripspace/cli@latest version
97
+ npm run build
98
+ joripspace deploy --cwd . --dir dist --entrypoint worker.js --label "Update app" --json
24
99
  ```
25
100
 
26
- If the version stays the same after an update, your terminal may still be using an older installation. Check its location with `Get-Command joripspace -All` in PowerShell or `command -v joripspace` on macOS and Linux. For an npm installation, `npm root -g` shows the directory containing `@joripspace/cli/bin/joripspace.js`, which you can run with Node.
27
-
28
- You can also run the CLI without a global installation:
29
-
30
- ```sh
31
- npx -y @joripspace/cli@latest --help
32
- npx -y @joripspace/cli@latest start PROJECT --json
101
+ The entrypoint is relative to `--dir`. Select the output directory even when `dist` is ignored at the project root;
102
+ do not remove credential ignore rules or upload an unbundled source that imports excluded `node_modules`.
103
+ Record the verified command in the app's `package.json` so subsequent deployments reuse it:
104
+
105
+ ```json
106
+ {
107
+ "scripts": {
108
+ "build": "node build.mjs",
109
+ "joripspace:deploy": "npm run build && npx --yes @joripspace/cli@latest deploy --cwd . --dir \"dist\" --entrypoint \"worker.js\""
110
+ }
111
+ }
33
112
  ```
34
113
 
35
- This selects the latest published npm release. Replace `PROJECT` with your existing project name. Installing the package does not log you in or change your project settings.
36
-
37
- ## Connect a project
38
-
39
- Open your project folder and run:
40
-
41
- ```sh
42
- joripspace login
43
- joripspace projects
44
- joripspace start PROJECT --json
45
- ```
46
-
47
- Follow the link to [JoripSpace Connect](https://joripspace.com/connect/), approve the connection in your browser, and enter the one-time code within five minutes. You can then connect a project and continue from its current source and deployment state.
48
-
49
- `start` connects an existing project. It also prepares the project instructions for your agent and synchronizes source files when required by the connection. To create a project first, see [Create a project](#create-a-project) below.
50
-
51
- To work in another folder, add `--cwd`. Quote paths that contain spaces:
52
-
53
- ```sh
54
- joripspace start my-app --cwd "my project" --json
55
- joripspace get --cwd "my project" --json
56
- ```
57
-
58
- Without `--cwd`, the CLI uses the current folder and searches its parent folders for a project connection. The connected project name is recorded in `.joripspace/project`.
59
-
60
- ## Work with a coding agent
61
-
62
- Use an agent that can run terminal commands, edit files, and access the network. You can send it this prompt after replacing `PROJECT` with your project name:
63
-
64
- ```text
65
- Help me get started with JoripSpace project "PROJECT".
66
- 1. Install or update the official CLI with npm install -g @joripspace/cli@latest.
67
- Compare the version that actually runs with the latest version on npm.
68
- If an older executable is still selected, find and use the updated npm CLI.
69
- 2. Run joripspace start PROJECT --json and read its onboarding guide
70
- and the project instruction files to complete the connection.
71
- 3. Review the existing project and explain the next steps for my task.
72
- ```
73
-
74
- If approval is needed, the response includes a connection link and commands to sign in and resume. After approving the connection, give your agent the five-minute code. It can pass the code without waiting for terminal input:
75
-
76
- ```sh
77
- joripspace login --code "CONNECTION_CODE" --json
78
- joripspace start PROJECT --json
79
- ```
80
-
81
- The CLI connection works without a plugin or MCP setup. If you also use MCP, its client has a separate sign-in process. Reuse a saved CLI login or complete the CLI connection flow when switching between them. See the [MCP connection guide](https://joripspace.com/en/docs/mcp/) for client setup and tool details.
82
-
83
- ### Project instructions
84
-
85
- `start` returns a guide and writes it into a marked JoripSpace section in `AGENTS.md`. New files place `User instructions` first, followed by `JoripSpace managed instructions`. Existing user content is preserved, and `CLAUDE.md` keeps a reference to `AGENTS.md`.
86
-
87
- Your agent can use the returned guide immediately. If it does not load project files automatically, ask it to read the listed files in the current conversation. No agent restart is needed for this workflow.
88
-
89
- The guide explains how to find relevant CLI help, MCP tools, and task guidance as needed. You do not have to copy every command option into your project instructions. The [task workflows](https://joripspace.com/en/docs/agent-workflows/) show how to use these tools for deployment, database changes, service connections, and reports.
90
-
91
- ## Find a command
92
-
93
- Start with the CLI help, then open the help for the command you want to use:
94
-
95
- ```sh
96
- joripspace --help
97
- joripspace deploy --help
98
- joripspace report --help
99
- ```
100
-
101
- | Task | Commands |
102
- | --- | --- |
103
- | Connect and inspect a project | `login`, `start`, `projects`, `get` |
104
- | Deploy and inspect history | `deploy`, `deployments`, `deployment get`, `deployment pull`, `rollback` |
105
- | Find and install templates | `templates`, `template list`, `install-template`, `template pull` |
106
- | Work with a database | `db schema`, `db query`, `db migrate` |
107
- | Manage stored files | `storage list`, `storage get`, `storage put`, `storage delete` |
108
- | Save and restore work | `checkpoint save`, `checkpoint list`, `checkpoint restore`, `checkpoint deploy` |
109
- | Manage Secrets | `secret list`, `secret generate`, `secret set`, `secret update` |
110
- | Manage realtime services | `realtime-v2 status`, `realtime-v2 activate`, `realtime-v2 keys` |
111
- | Connect domains, schedules, and mail | `domain`, `cron`, `mail` |
112
- | Inspect errors and usage | `events`, `usage-summary`, `usage-breakdown` |
113
- | Prepare GitHub workflows or find guidance | `github prepare`, `knowledge search` |
114
- | Report a problem or suggest an improvement | `report` |
115
- | Identify or revoke a connection token | `tokens current`, `tokens revoke` |
116
-
117
- The [CLI reference](https://joripspace.com/en/docs/cli/) covers the command groups and common options. GitHub source synchronization and template Git history features also require Git.
118
-
119
- ## Report a problem or suggest an improvement
120
-
121
- Use `report` while connected to the relevant project. Choose `problem` for a general issue, `bug` for a defect, or `feedback` for an improvement idea:
122
-
123
- ```sh
124
- joripspace report --project PROJECT --category bug --summary "Deployment status is incorrect" --details "Steps to reproduce the issue" --json
125
- joripspace report --project PROJECT --category feedback --summary "Add deployment history filters" --expected "Search by label" --json
126
- ```
127
-
128
- A summary is required. You can add context with `--details`, describe the desired and current behavior with `--expected` and `--actual`, or include an error code with `--error-code`. CLI, Node.js, and OS information is attached automatically.
129
-
130
- Review the content before sending and leave out credentials, personal data, and private source code. If you are working with an agent, ask it to submit the report when you are ready. A successful response includes the report ID, `report_id`. If the response is interrupted, the report may already have been received, so avoid sending the same report repeatedly.
131
-
132
- `feedback` is a category of `report`, not a separate command. The feedback category and dedicated `report --help` are available in CLI 0.6.1 and later.
133
-
134
- ## Revoke an exposed connection token
135
-
136
- If a connection token has been exposed, you can disable it on the server. First check its ID, then revoke the current token:
137
-
138
- ```sh
139
- joripspace tokens current
140
- joripspace tokens revoke --current
141
- ```
142
-
143
- `tokens current` shows the ID without revealing the token value. Revoking the token ends the current connection and any MCP sessions using the same token. Use a fresh connection code to connect again.
144
-
145
- To revoke a token from an older connection, sign in with another valid token in the same account and specify the exact ID:
146
-
147
- ```sh
148
- joripspace tokens revoke --token-id TOKEN_ID
149
- ```
150
-
151
- Check the target ID before running the command. You can also disable tokens on the API token page in your web profile. These CLI commands are available in 0.6.1 and later. `logout` removes a saved local login; it does not revoke the server token.
152
-
153
- ## Saved logins
154
-
155
- The CLI saves new logins in Windows Credential Manager, macOS Keychain, or Linux Secret Service when available. You can reuse that login across project folders under the same OS account. The project's Git-ignored `.env.joripspace` then contains only connection details such as the API URL, account ID, and connection source. An ordinary application `.env` file is not used for CLI authentication.
156
-
157
- If an OS credential store is unavailable before saving, the CLI stores the token in the selected project's `.env.joripspace` instead. This fallback is used only for that project. Keep the file out of Git, deployments, and checkpoints. The login response identifies the storage method as `os-credential-store` or `project-env-fallback`.
158
-
159
- If an OS credential write or verification fails, login stops without creating a file fallback. Once the store is available, running `login` can move an existing project-file token into it and remove the token from the file.
160
-
161
- `logout` removes the saved token entries in the current project file and the matching OS credential when available. Because an OS login is shared, removing it also affects other folders that use it. Other legacy folders and credentials supplied through environment variables are separate. A later OS login can be reused across folders, including folders where you previously logged out.
162
-
163
- For automation, supply `JORIPSPACE_API_TOKEN` and its matching `JORIPSPACE_API_URL` through the process environment. The default API address is `https://api.joripspace.com`; `--api-url` can select another endpoint. Existing project markers, `--project`, environment authentication, and legacy credential migration remain supported.
164
-
165
- ## Project Secrets
166
-
167
- If your app needs a random value, such as a session signing key, generate one without displaying it:
168
-
169
- ```sh
170
- joripspace secret generate --name SESSION_SECRET --json
171
- joripspace secret list --json
172
- ```
173
-
174
- An existing active value is preserved. For a key issued by an external provider, use `secret set --name API_KEY --value-stdin --json`, or its alias, `secret update`. Pass the exact value through standard input rather than command arguments, chat, logs, source, or temporary project files. Input must be 1–5120 UTF-8 bytes; whitespace and newlines are preserved. Secret values are never returned.
175
-
176
- You can also enter a key on the selected project's Secret page. `start` and Secret command responses include its `secret_management_url`, which your agent can show as a clickable link. Choose **Register or replace** to save the value, then check the name, status, and change time with `secret list`. Test the service connection afterward. Secret deletion remains a web operation, and all changes require project access and valid, non-reserved key names.
177
-
178
- ## Create a project
179
-
180
- To create a new Free project, run `joripspace create --name my-app --json` first. It returns all three required agreements
181
- in English with the Korean web originals. Login is verified with the server before any agreements are shown;
182
- missing or revoked credentials stop creation. Agents must present the agreements faithfully in the user's language
183
- and obtain explicit consent before rerunning with `--agree-noncommercial --agree-billing --agree-retention --json`. Interactive
184
- terminals ask each agreement separately. `--yes` cannot replace consent. Web/server name restrictions and uniqueness
185
- checks apply. Creation does not link or change local project source; use `start` separately when requested.
186
-
187
- ## JSON output and agent integrations
188
-
189
- Add `--json` for structured output without browser launch or interactive prompts. Successful results go to stdout, and errors go to stderr. Existing result fields and exit codes `0`, `1`, and `2` are preserved. The shared agent guide is English; CLI notices and prompts follow the OS locale, using Korean for `ko` and English otherwise. JSON field names and error codes remain unchanged. Agreement payloads retain the English text and Korean originals so agents can explain them in your conversation language.
190
-
191
- The `onboarding` object provides `schema_version`, `instructions`, `read_files`, `invocation`, and `commands`. It also appears under `error.details.onboarding` when authentication is required, along with the login and resume steps.
192
-
193
- For tools that accept a command and argument list, run `invocation.command`, append CLI arguments after `invocation.args`, and use `invocation.cwd` as the working folder. With an npm installation, this runs Node with the absolute JavaScript entrypoint. The `executable`, `login_command`, `resume_command`, and `install_command` fields remain available for existing integrations. In PowerShell, use `&` before a quoted executable path.
194
-
195
- If an interactive connection cannot open a browser, open the printed URL yourself. Interactive `start` uses Windows `cmd.exe`, macOS `open`, or Linux `xdg-open` for that step.
196
-
197
- ## What's new in 0.6.1
198
-
199
- - Submit improvement suggestions with `report --category feedback` and read the dedicated `report --help`.
200
- - Identify the current connection token and revoke exposed tokens with `tokens current` and `tokens revoke`.
201
- - Keep user instructions separate from the managed JoripSpace section in `AGENTS.md`, with existing user content preserved.
202
- - The onboarding guide now asks your coding agent to check the running CLI version against npm, use the CLI when available, and keep CLI and MCP logins separate.
203
- - Find current command options and task guidance as needed, with links to the public CLI, MCP, and workflow documentation.
204
-
205
- ## Development and package verification
206
-
207
- This repository works independently of the platform repository and runs without a compilation step. To check the source and package:
208
-
209
- ```sh
210
- npm ci --ignore-scripts
211
- npm run check
212
- npm test
213
- npm run test:package
214
- ```
215
-
216
- The package's `prepack` check validates metadata, JavaScript syntax, the Node shebang, and executable permissions. There are no installation lifecycle hooks.
217
-
218
- `test:package` builds a tarball in `.artifacts/` and checks its contents, hashes, licenses, and permissions. It then verifies clean installation, npx, npm exec, arguments, output, exit codes, working folders, cancellation, and saved login reuse against a local mock API. Temporary test folders include paths with spaces and Korean characters. Production projects and real user credentials are not used.
219
-
220
- Set `JORIPSPACE_BASELINE_CLI` to an original `bin/joripspace.js` to compare against that CLI. Otherwise, comparisons use this repository's source. To try the tarball before publishing:
221
-
222
- ```sh
223
- npm exec --yes --package="/absolute/path/joripspace-cli-VERSION.tgz" -- joripspace --help
224
- ```
225
-
226
- Replace `VERSION` with the tarball version. On Windows, use a path such as `C:/path/to/joripspace-cli-VERSION.tgz`. See the [release guide](https://github.com/JoripSpace/joripspace-cli/blob/main/docs/release.md) for the local publishing procedure. Package checks and npm publishing run locally; this repository does not use GitHub Actions for them.
227
-
228
- ## License
229
-
230
- JoripSpace CLI is available under the [MIT License](LICENSE).
231
-
232
- Copyright (c) 2026 Cosmosfarm Software
233
-
234
- Use of the JoripSpace cloud service is subject to separate service terms and pricing plans. Platform server, administration, and infrastructure code are not included in this CLI distribution. Included Worker examples are public customer templates.
235
-
236
- Third-party dependencies retain their original licenses and copyrights. See [Third-party notices](THIRD_PARTY_NOTICES.md) for the preserved license texts.
237
-
238
- ## Support
239
-
240
- - Documentation: [CLI reference](https://joripspace.com/en/docs/cli/) · [MCP connection and tools](https://joripspace.com/en/docs/mcp/) · [Task workflows](https://joripspace.com/en/docs/agent-workflows/)
241
- - Platform problems and suggestions: use `joripspace report` from a connected project.
242
- - CLI repository issues: [GitHub Issues](https://github.com/JoripSpace/joripspace-cli/issues)
243
- - Email: [support@cosmosfarm.com](mailto:support@cosmosfarm.com)
114
+ Merge this into the existing scripts, preserving custom commands and using the actual build output paths.
115
+ When deployment is requested, run `npm run joripspace:deploy -- --label "Describe the change"`.
116
+ The build must succeed before upload. Check deployment status and the production root and changed routes afterward.
117
+ GitHub-connected projects use their configured workflow and trigger instead of this direct-deployment script.
118
+
119
+ The source tree also implements `deploy --prepare --dir dist --entrypoint worker.js --json`, which validates
120
+ the built output and saves that script without deploying. This option is available in 0.7.0 and later; check the executing
121
+ CLI's `deploy --help` before using it. Existing published CLIs can use the manual script above.
122
+
123
+ ## Refresh guidance without changing app source
124
+
125
+ `start` can synchronize GitHub source or restore a deployment into an empty workspace. Do not use it merely to
126
+ refresh instructions. For guide-only maintenance, authenticated MCP clients call `prepare_project_workspace`
127
+ with `guide_only: true`; the server omits source sync, legacy migrations, scaffold recovery, and service questions.
128
+ This is a server capability, not a new CLI option.
129
+
130
+ Without MCP, fetch `https://api.joripspace.com/onboarding.md` and use the section starting at the heading line
131
+ `# JoripSpace project onboarding` to refresh only the bounded JoripSpace block in `AGENTS.md` and maintain the
132
+ `CLAUDE.md` import. Preserve user instructions, the project marker, credentials, and application files.
133
+
134
+ ## Find a command
135
+
136
+ Start with the CLI help, then open the help for the command you want to use:
137
+
138
+ ```sh
139
+ joripspace --help
140
+ joripspace deploy --help
141
+ joripspace report --help
142
+ ```
143
+
144
+ | Task | Commands |
145
+ | --- | --- |
146
+ | Connect and inspect a project | `login`, `start`, `projects`, `get` |
147
+ | Deploy and inspect history | `deploy`, `deployments`, `deployment get`, `deployment pull`, `rollback` |
148
+ | Find and install templates | `templates`, `template list`, `install-template`, `template pull` |
149
+ | Work with a database | `db schema`, `db query`, `db migrate` |
150
+ | Manage stored files | `storage list`, `storage get`, `storage put`, `storage delete` |
151
+ | Save and restore work | `checkpoint save`, `checkpoint list`, `checkpoint restore`, `checkpoint deploy` |
152
+ | Manage Secrets | `secret list`, `secret generate`, `secret set`, `secret update` |
153
+ | Manage realtime services | `realtime-v2 status`, `realtime-v2 activate`, `realtime-v2 keys` |
154
+ | Connect domains, schedules, and mail | `domain`, `cron`, `mail` |
155
+ | Inspect errors and usage | `events`, `usage-summary`, `usage-breakdown` |
156
+ | Prepare GitHub workflows or find guidance | `github prepare`, `knowledge search` |
157
+ | Report a problem or suggest an improvement | `report` |
158
+ | Identify or revoke a connection token | `tokens current`, `tokens revoke` |
159
+
160
+ The [CLI reference](https://joripspace.com/en/docs/cli/) covers the command groups and common options. GitHub source synchronization and template Git history features also require Git.
161
+
162
+ ## Report a problem or suggest an improvement
163
+
164
+ Use `report` while connected to the relevant project. Choose `problem` for a general issue, `bug` for a defect, or `feedback` for an improvement idea:
165
+
166
+ ```sh
167
+ joripspace report --project PROJECT --category bug --summary "Deployment status is incorrect" --details "Steps to reproduce the issue" --json
168
+ joripspace report --project PROJECT --category feedback --summary "Add deployment history filters" --expected "Search by label" --json
169
+ ```
170
+
171
+ A summary is required. You can add context with `--details`, describe the desired and current behavior with `--expected` and `--actual`, or include an error code with `--error-code`. CLI, Node.js, and OS information is attached automatically.
172
+
173
+ Review the content before sending and leave out credentials, personal data, and private source code. If you are working with an agent, ask it to submit the report when you are ready. A successful response includes the report ID, `report_id`. If the response is interrupted, the report may already have been received, so avoid sending the same report repeatedly.
174
+
175
+ `feedback` is a category of `report`, not a separate command. The feedback category and dedicated `report --help` are available in CLI 0.6.1 and later.
176
+
177
+ ## Revoke an exposed connection token
178
+
179
+ If a connection token has been exposed, you can disable it on the server. First check its ID, then revoke the current token:
180
+
181
+ ```sh
182
+ joripspace tokens current
183
+ joripspace tokens revoke --current
184
+ ```
185
+
186
+ `tokens current` shows the ID without revealing the token value. Revoking the token ends the current connection and any MCP sessions using the same token. Use a fresh connection code to connect again.
187
+
188
+ To revoke a token from an older connection, sign in with another valid token in the same account and specify the exact ID:
189
+
190
+ ```sh
191
+ joripspace tokens revoke --token-id TOKEN_ID
192
+ ```
193
+
194
+ Check the target ID before running the command. You can also disable tokens on the API token page in your web profile. These CLI commands are available in 0.6.1 and later. `logout` removes a saved local login; it does not revoke the server token.
195
+
196
+ ## Saved logins
197
+
198
+ The CLI saves new logins in Windows Credential Manager, macOS Keychain, or Linux Secret Service when available. You can reuse that login across project folders under the same OS account. The project's Git-ignored `.env.joripspace` then contains only connection details such as the API URL, account ID, and connection source. An ordinary application `.env` file is not used for CLI authentication.
199
+
200
+ If an OS credential store is unavailable before saving, the CLI stores the token in the selected project's `.env.joripspace` instead. This fallback is used only for that project. Keep the file out of Git, deployments, and checkpoints. The login response identifies the storage method as `os-credential-store` or `project-env-fallback`.
201
+
202
+ If an OS credential write or verification fails, login stops without creating a file fallback. Once the store is available, running `login` can move an existing project-file token into it and remove the token from the file.
203
+
204
+ `logout` removes the saved token entries in the current project file and the matching OS credential when available. Because an OS login is shared, removing it also affects other folders that use it. Other legacy folders and credentials supplied through environment variables are separate. A later OS login can be reused across folders, including folders where you previously logged out.
205
+
206
+ For automation, supply `JORIPSPACE_API_TOKEN` and its matching `JORIPSPACE_API_URL` through the process environment. The default API address is `https://api.joripspace.com`; `--api-url` can select another endpoint. Existing project markers, `--project`, environment authentication, and legacy credential migration remain supported.
207
+
208
+ ## Project Secrets
209
+
210
+ If your app needs a random value, such as a session signing key, generate one without displaying it:
211
+
212
+ ```sh
213
+ joripspace secret generate --name SESSION_SECRET --json
214
+ joripspace secret list --json
215
+ ```
216
+
217
+ An existing active value is preserved. For a key issued by an external provider, use `secret set --name API_KEY --value-stdin --json`, or its alias, `secret update`. Pass the exact value through standard input rather than command arguments, chat, logs, source, or temporary project files. Input must be 1–5120 UTF-8 bytes; whitespace and newlines are preserved. Secret values are never returned.
218
+
219
+ You can also enter a key on the selected project's Secret page. `start` and Secret command responses include its `secret_management_url`, which your agent can show as a clickable link. Choose **Register or replace** to save the value, then check the name, status, and change time with `secret list`. Test the service connection afterward. Secret deletion remains a web operation, and all changes require project access and valid, non-reserved key names.
220
+
221
+ ## Create a project
222
+
223
+ To create a new Free project, run `joripspace create --name my-app --json` first. It returns all three required agreements
224
+ in English with the Korean web originals. Login is verified with the server before any agreements are shown;
225
+ missing or revoked credentials stop creation. Agents must present the agreements faithfully in the user's language
226
+ and obtain explicit consent before rerunning with `--agree-noncommercial --agree-billing --agree-retention --json`. Interactive
227
+ terminals ask each agreement separately. `--yes` cannot replace consent. Web/server name restrictions and uniqueness
228
+ checks apply. Creation does not link or change local project source; use `start` separately when requested.
229
+
230
+ ## JSON output and agent integrations
231
+
232
+ Add `--json` for structured output without browser launch or interactive prompts. Successful results go to stdout, and errors go to stderr. Existing result fields and exit codes `0`, `1`, and `2` are preserved. The shared agent guide is English; CLI notices and prompts follow the OS locale, using Korean for `ko` and English otherwise. JSON field names and error codes remain unchanged. Agreement payloads retain the English text and Korean originals so agents can explain them in your conversation language.
233
+
234
+ The `onboarding` object provides `schema_version`, `instructions`, `read_files`, `invocation`, and `commands`. It also appears under `error.details.onboarding` when authentication is required, along with the login and resume steps.
235
+
236
+ For tools that accept a command and argument list, run `invocation.command`, append CLI arguments after `invocation.args`, and use `invocation.cwd` as the working folder. With an npm installation, this runs Node with the absolute JavaScript entrypoint. The `executable`, `login_command`, `resume_command`, and `install_command` fields remain available for existing integrations. In PowerShell, use `&` before a quoted executable path.
237
+
238
+ If an interactive connection cannot open a browser, open the printed URL yourself. Interactive `start` uses Windows `cmd.exe`, macOS `open`, or Linux `xdg-open` for that step.
239
+
240
+ ## What's new in 0.6.1
241
+
242
+ - Submit improvement suggestions with `report --category feedback` and read the dedicated `report --help`.
243
+ - Identify the current connection token and revoke exposed tokens with `tokens current` and `tokens revoke`.
244
+ - Keep user instructions separate from the managed JoripSpace section in `AGENTS.md`, with existing user content preserved.
245
+ - The onboarding guide now asks your coding agent to check the running CLI version against npm, use the CLI when available, and keep CLI and MCP logins separate.
246
+ - Find current command options and task guidance as needed, with links to the public CLI, MCP, and workflow documentation.
247
+
248
+ ## Development and package verification
249
+
250
+ This repository works independently of the platform repository and runs without a compilation step. To check the source and package:
251
+
252
+ ```sh
253
+ npm ci --ignore-scripts
254
+ npm run check
255
+ npm test
256
+ npm run test:package
257
+ ```
258
+
259
+ The package's `prepack` check validates metadata, JavaScript syntax, the Node shebang, and executable permissions. There are no installation lifecycle hooks.
260
+
261
+ `test:package` builds a tarball in `.artifacts/` and checks its contents, hashes, licenses, and permissions. It then verifies clean installation, npx, npm exec, arguments, output, exit codes, working folders, cancellation, and saved login reuse against a local mock API. Temporary test folders include paths with spaces and Korean characters. Production projects and real user credentials are not used.
262
+
263
+ Set `JORIPSPACE_BASELINE_CLI` to an original `bin/joripspace.js` to compare against that CLI. Otherwise, comparisons use this repository's source. To try the tarball before publishing:
264
+
265
+ ```sh
266
+ npm exec --yes --package="/absolute/path/joripspace-cli-VERSION.tgz" -- joripspace --help
267
+ ```
268
+
269
+ Replace `VERSION` with the tarball version. On Windows, use a path such as `C:/path/to/joripspace-cli-VERSION.tgz`. See the [release guide](https://github.com/JoripSpace/joripspace-cli/blob/main/docs/release.md) for the local publishing procedure. Package checks and npm publishing run locally; this repository does not use GitHub Actions for them.
270
+
271
+ ## License
272
+
273
+ JoripSpace CLI is available under the [MIT License](LICENSE).
274
+
275
+ Copyright (c) 2026 Cosmosfarm Software
276
+
277
+ Use of the JoripSpace cloud service is subject to separate service terms and pricing plans. Platform server, administration, and infrastructure code are not included in this CLI distribution. Included Worker examples are public customer templates.
278
+
279
+ Third-party dependencies retain their original licenses and copyrights. See [Third-party notices](THIRD_PARTY_NOTICES.md) for the preserved license texts.
280
+
281
+ ## Support
282
+
283
+ - Documentation: [CLI reference](https://joripspace.com/en/docs/cli/) · [MCP connection and tools](https://joripspace.com/en/docs/mcp/) · [Task workflows](https://joripspace.com/en/docs/agent-workflows/)
284
+ - Platform problems and suggestions: use `joripspace report` from a connected project.
285
+ - CLI repository issues: [GitHub Issues](https://github.com/JoripSpace/joripspace-cli/issues)
286
+ - Email: [support@cosmosfarm.com](mailto:support@cosmosfarm.com)
package/bin/joripspace.js CHANGED
@@ -218,6 +218,23 @@ async function main() {
218
218
  printDeployHelp();
219
219
  return;
220
220
  }
221
+ if (flags.prepare) {
222
+ const project = requireProjectId(flags);
223
+ const details = await apiRequest(flags, `/v1/projects/${encodeURIComponent(project)}`, {
224
+ method: 'GET',
225
+ ...projectAuth(flags),
226
+ });
227
+ if (details?.deployment?.mode === 'github_actions') {
228
+ throw new Error('GitHub deployment is connected: use its configured workflow and trigger');
229
+ }
230
+ const result = require('../lib/deploy-prepare').prepareDeployment(
231
+ projectWorkspaceDir(flags),
232
+ flags,
233
+ writeTextAtomically
234
+ );
235
+ output(flags, result, (value) => console.log(value.next_action));
236
+ return;
237
+ }
221
238
  await deployCode(flags);
222
239
  return;
223
240
  case 'templates':
@@ -0,0 +1,48 @@
1
+ const fs = require('node:fs');
2
+ const path = require('node:path');
3
+ const { resolveProjectFileTarget } = require('./project-paths');
4
+ const { buildDeployPayload } = require('./deploy-files');
5
+
6
+ // Preparation validates the actual build output, but never uploads or deploys it.
7
+ function prepareDeployment(workspace, flags, writeTextAtomically) {
8
+ const dir = String(flags.dir || '');
9
+ const entrypoint = String(flags.entrypoint || '');
10
+ for (const value of [dir, entrypoint]) {
11
+ if (!value || !/^[a-zA-Z0-9_./ -]+$/.test(value) || value.startsWith('-')) {
12
+ throw new Error(
13
+ 'deploy --prepare requires project-relative --dir and --entrypoint (letters, digits, spaces, _, -, ., /)'
14
+ );
15
+ }
16
+ }
17
+ const outputLocation = resolveProjectFileTarget(workspace, `${dir}/${entrypoint}`);
18
+ if (outputLocation.blockers.length || !fs.existsSync(outputLocation.target)) {
19
+ throw new Error('Build the project first: the configured Worker entrypoint does not exist');
20
+ }
21
+ try {
22
+ buildDeployPayload({ ...flags, cwd: workspace, dir: path.resolve(workspace, dir), entrypoint });
23
+ } catch (error) {
24
+ if (error.code !== 'archive_required') throw error;
25
+ }
26
+ const location = resolveProjectFileTarget(workspace, 'package.json');
27
+ if (location.blockers.length) throw new Error('package.json path is blocked');
28
+ const pkg = JSON.parse(fs.readFileSync(location.target, 'utf8'));
29
+ if (pkg.scripts != null && (typeof pkg.scripts !== 'object' || Array.isArray(pkg.scripts))) {
30
+ throw new Error('package.json scripts must be an object');
31
+ }
32
+ const scripts = pkg.scripts || {};
33
+ const command = `${typeof scripts.build === 'string' ? 'npm run build && ' : ''}npx --yes @joripspace/cli@latest deploy --cwd . --dir "${dir}" --entrypoint "${entrypoint}"`;
34
+ if (scripts['joripspace:deploy'] && scripts['joripspace:deploy'] !== command) {
35
+ throw new Error('Existing joripspace:deploy script was preserved; review it before preparing deployment');
36
+ }
37
+ pkg.scripts = { ...scripts, 'joripspace:deploy': command };
38
+ writeTextAtomically(location.target, `${JSON.stringify(pkg, null, 2)}\n`);
39
+ return {
40
+ status: 'prepared',
41
+ script: 'joripspace:deploy',
42
+ command,
43
+ next_action: 'npm run joripspace:deploy -- --label "배포 변경 내용"',
44
+ deployed: false,
45
+ };
46
+ }
47
+
48
+ module.exports = { prepareDeployment };