@sufleur/cli 0.1.0 → 0.3.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.
Files changed (2) hide show
  1. package/README.md +60 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -74,6 +74,8 @@ Plus exported types per entrypoint:
74
74
  export type CodeReview_EnInput = { diff: string; language: string };
75
75
  ```
76
76
 
77
+ Optional schema properties are emitted with `?:`, and `oneOf` schemas become TypeScript union types.
78
+
77
79
  Prompts published with `DRAFT` status emit a runtime `console.warn` when their `getPrompt` is called.
78
80
 
79
81
  ## sufleur.yaml
@@ -119,6 +121,64 @@ sufleur generate
119
121
 
120
122
  `-v` / `--verbose` enables HTTP request/response logs on any command. Variables in `.env` are loaded automatically; per-workspace API keys can be referenced as `${ENV_VAR_NAME}` in `sufleur.yaml`.
121
123
 
124
+ ## Authoring prompts from the CLI
125
+
126
+ The commands above install **published** prompts into your project. The CLI also exposes the full authoring side — designed so a coding agent (Claude Code, Cursor, etc.) can create, version, and edit prompts in your Sufleur workspace on your behalf.
127
+
128
+ ### Hand it to your agent
129
+
130
+ `sufleur skill` prints a markdown skill description — when to use the CLI, FQ-name format, the full command surface, JSON flags. Pipe it wherever your agent loads skills from:
131
+
132
+ ```bash
133
+ # Claude Code (each skill is a directory with a SKILL.md inside)
134
+ mkdir -p ~/.claude/skills/sufleur && sufleur skill > ~/.claude/skills/sufleur/SKILL.md
135
+
136
+ # Cursor
137
+ sufleur skill > .cursor/rules/sufleur.md
138
+ ```
139
+
140
+ The skill ships inside the binary, so it always matches the `sufleur` version on your `PATH`.
141
+
142
+ ### Log in
143
+
144
+ ```bash
145
+ sufleur login # device-code flow — opens a browser, polls until approved
146
+ sufleur me # show the authenticated user
147
+ sufleur logout # revoke the stored credential
148
+ ```
149
+
150
+ Credentials land in `$XDG_CONFIG_HOME/sufleur/credentials.yaml` (or `~/.config/sufleur/credentials.yaml`). This user credential is separate from the workspace API keys referenced in `sufleur.yaml` — those stay machine-to-machine, this one identifies you as the author.
151
+
152
+ ### Authoring commands
153
+
154
+ All accept `--json`. Prompts are addressed as `@workspace/name`, versions as `@workspace/name@version` (use the literal label `draft` while the version is unpublished).
155
+
156
+ | Command | What it does |
157
+ | ------- | ------------ |
158
+ | `prompt create @ws/name --description "..."` | Create a new prompt in a workspace |
159
+ | `prompt list @ws [--search ... --limit ... --offset ...]` | List prompts in a workspace |
160
+ | `prompt get @ws/name` | Show one prompt's details |
161
+ | `prompt update @ws/name --description "..."` | Update the description |
162
+ | `version draft @ws/name` | Fork the latest published version into a new draft |
163
+ | `version list @ws/name [--status DRAFT\|PUBLISHED]` | List versions of a prompt |
164
+ | `version get @ws/name@version` | Show one version's details |
165
+ | `version delete @ws/name@draft` | Delete a draft (published versions are immutable) |
166
+ | `version set-metadata @ws/name@draft --string K=V` (or `--from-file …`) | Patch or sync metadata |
167
+ | `version delete-metadata @ws/name@draft --key K` | Remove a metadata key |
168
+ | `version set-output-schema @ws/name@draft --file schema.json` | Replace the version's output schema |
169
+ | `version set-readme @ws/name@draft [--content STR \| --file PATH]` | Replace the version's README |
170
+ | `version get-readme @ws/name@version` | Print the version's README to stdout (raw markdown) |
171
+ | `version dump @ws/name@version --to ./dir` | Export files, output schema, README, and metadata to disk |
172
+ | `file list @ws/name@version` | List files in a version |
173
+ | `file create @ws/name@draft --file path.mustache [--entrypoint]` | Add a new file |
174
+ | `file update @ws/name@draft --name X [--file ...] [--rename Y]` | Replace content and/or rename |
175
+ | `file delete @ws/name@draft --name X` | Delete a file |
176
+ | `file set-entrypoint @ws/name@draft --name X [--clear]` | Mark (or unmark) a file as an entrypoint |
177
+
178
+ ### Render before publishing
179
+
180
+ `sufleur prompt render <dir> --entrypoint <name> [--vars '{...}' | --vars-file path.json]` runs the same Mustache pipeline as the generated runtime — useful for previewing a draft locally before publishing, or for quick experimentation against a `version dump` directory. No auth required.
181
+
122
182
  ## Supported platforms
123
183
 
124
184
  | OS | Architectures |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sufleur/cli",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "CLI for sufleur — type-safe codegen for versioned LLM prompts.",
5
5
  "keywords": [
6
6
  "sufleur",