@orqint/cli 0.1.0 → 0.1.2

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,100 +1,73 @@
1
1
  # Orqint
2
2
 
3
- CLI orchestration for Cursor-native `think` / `plan` workflows. See [docs/PRD/PRD.md](docs/PRD/PRD.md).
3
+ CLI orchestration for Cursor-native `think` / `plan` workflows (prepare in the CLI → work in Cursor → apply JSON back). Deep product spec: [docs/PRD/PRD.md](docs/PRD/PRD.md).
4
4
 
5
- **Maintainers:** CLI source lives under [`packages/cli/`](packages/cli/README.md). Root folder [`orqint/`](orqint/core/) holds **project state** (`memory.json`, etc.) for this repo only, not TypeScript sources. Full map: [docs/Repository-layout.md](docs/Repository-layout.md).
5
+ ## Use Orqint in your project
6
6
 
7
- ## Prerequisites
8
-
9
- - Node.js (LTS)
10
- - [pnpm](https://pnpm.io/installation) (for developing this repo)
11
- - [npm](https://www.npmjs.com/) (ships with Node; used by `npx` and `orqint update`)
12
-
13
- ## Run with `npx` (no global install)
14
-
15
- After the package is **published to npm** (see below):
7
+ You need [Node.js](https://nodejs.org/) (LTS). From your **project root**:
16
8
 
17
9
  ```bash
18
- npx --yes @orqint/cli@latest version
19
10
  npx --yes @orqint/cli@latest init
20
11
  ```
21
12
 
22
- Check for updates (queries the registry):
23
-
24
- ```bash
25
- npx --yes @orqint/cli@latest update
26
- ```
13
+ 1. **`init`** creates the `orqint/` layout (`memory.json`, prompts, handoff folder, etc.).
14
+ 2. It also installs **user assets** when missing: **`AGENTS.md`**, **`ORQINT.md`**, and **`.cursor/rules/orqint-workflow.mdc`** (so Cursor can help with handoffs). Existing files are **not** overwritten — use **`orqint init --force-user-assets`** only if you want to refresh those from the package.
15
+ 3. Open **`ORQINT.md`** in your repo for the short workflow (commands and tables).
27
16
 
28
- Run the latest published CLI via npx (recommended when a newer version exists):
17
+ Other commands (after init):
29
18
 
30
19
  ```bash
20
+ npx --yes @orqint/cli@latest update
31
21
  npx --yes @orqint/cli@latest <command>
32
22
  ```
33
23
 
34
- `orqint update --install <args>` re-invokes `npx @orqint/cli@latest <args>` for you when a newer version is available.
24
+ `orqint init --brownfield` can seed hints from your `package.json` / `README.md`. `orqint init --force` resets **Orqint runtime** (e.g. `memory.json`) and does **not** replace your root `AGENTS.md` / `ORQINT.md` / Cursor rules unless you also pass **`--force-user-assets`**.
35
25
 
36
- ### Publish (maintainers)
26
+ ---
37
27
 
38
- From this repo, with an npm login that can publish to the `@orqint` scope:
28
+ ## Maintainers this repository
39
29
 
40
- ```bash
41
- npm run build
42
- npm publish
43
- ```
30
+ CLI source: [`packages/cli/`](packages/cli/README.md). Root [`orqint/`](orqint/core/) is **project state** for dogfooding (not TypeScript sources). Shipped **user-facing** files for npm live under **`user-assets/`** (see [user-assets/FOR_MAINTAINERS.md](user-assets/FOR_MAINTAINERS.md)). Layout map: [docs/Repository-layout.md](docs/Repository-layout.md).
44
31
 
45
- The package is scoped as `@orqint/cli`; `publishConfig.access` is `public` so `npm publish` does not require extra flags.
32
+ ### Prerequisites (development)
46
33
 
47
- ## Install the `orqint` command (this machine)
34
+ - Node.js (LTS)
35
+ - [pnpm](https://pnpm.io/installation)
36
+ - npm (for `npx` and `orqint update`)
48
37
 
49
- From the **root of this repository**:
38
+ ### Publish
50
39
 
51
40
  ```bash
52
- pnpm run cli:install
41
+ npm run build
42
+ npm publish
53
43
  ```
54
44
 
55
- This installs dependencies, builds `dist/`, and runs `pnpm link --global` so `orqint` is on your PATH.
45
+ Scoped package **`@orqint/cli`**; `publishConfig.access` is `public`.
56
46
 
57
- On Windows (no `bash`), use:
47
+ ### Install `orqint` globally from this clone
58
48
 
59
49
  ```bash
60
- pnpm run cli:install:pnpm
50
+ pnpm run cli:install
61
51
  ```
62
52
 
63
- If `orqint` is not found, add pnpm’s global bin directory to your PATH (run `pnpm bin -g` to see it).
53
+ Windows (no bash): `pnpm run cli:install:pnpm`. If `orqint` is not on PATH, see `pnpm bin -g`.
64
54
 
65
- **Shell alternative (same steps):**
55
+ Shell alternative: `bash scripts/setup-cli.sh`
66
56
 
67
- ```bash
68
- bash scripts/setup-cli.sh
69
- ```
70
-
71
- ## Update after pulling changes
57
+ ### Update after pulling
72
58
 
73
59
  ```bash
74
60
  pnpm run cli:upgrade
75
61
  ```
76
62
 
77
- Or:
78
-
79
- ```bash
80
- bash scripts/update-cli.sh
81
- ```
82
-
83
- `cli:upgrade` runs `git pull --rebase` (when this folder is a git repo), then reinstalls and rebuilds. Your global link keeps pointing at this folder, so you immediately get the new build.
84
-
85
- After you `git pull` yourself (or without git), you can run:
86
-
87
- ```bash
88
- pnpm run cli:upgrade:pnpm
89
- ```
63
+ Or `pnpm run cli:upgrade:pnpm` without `git pull` inside the script.
90
64
 
91
- ## Use in a test project
65
+ ### Test project (local build)
92
66
 
93
- 1. Build / install CLI as above.
94
- 2. Open an empty folder in Cursor.
95
- 3. Run `orqint init`, then follow [AGENTS.md](AGENTS.md) and [docs/orqint-cursor-starter.md](docs/orqint-cursor-starter.md).
67
+ 1. Build / link CLI as above.
68
+ 2. In a throwaway folder: `orqint init`, then follow **[user-assets/ORQINT.md](user-assets/ORQINT.md)** (same text users get) and [docs/orqint-cursor-starter.md](docs/orqint-cursor-starter.md).
96
69
 
97
- ## Use without global install
70
+ ### Run CLI without global install (this repo)
98
71
 
99
72
  ```bash
100
73
  pnpm run build
@@ -1,5 +1,6 @@
1
1
  export type InitOptions = {
2
2
  force?: boolean;
3
+ forceUserAssets?: boolean;
3
4
  brownfield?: boolean;
4
5
  migrateLegacy?: boolean;
5
6
  };
@@ -59,6 +59,12 @@ async function runInit(cwd, opts) {
59
59
  await fs.ensureDir(path.join(root, ".handoff"));
60
60
  await fs.ensureDir((0, paths_1.orqintSpecDir)(cwd));
61
61
  await fs.ensureDir((0, paths_1.orqintArchiveDir)(cwd));
62
+ const userAssetsCopied = await copyUserAssets(cwd, opts);
63
+ if (userAssetsCopied > 0) {
64
+ (0, logger_1.log)("info", "init_next_step", {
65
+ hint: "Open ORQINT.md in your project root for the workflow overview.",
66
+ });
67
+ }
62
68
  let memory = (0, memory_1.ensureDefaults)(JSON.parse(JSON.stringify(memory_1.EMPTY_MEMORY)));
63
69
  if (opts.brownfield) {
64
70
  memory = await seedFromRepo(cwd, memory);
@@ -70,6 +76,43 @@ async function runInit(cwd, opts) {
70
76
  await (0, memory_1.writeMemory)(cwd, memory);
71
77
  (0, logger_1.log)("info", "init_complete", { cwd, brownfield: !!opts.brownfield });
72
78
  }
79
+ /** Installed package root (contains `user-assets/` next to `dist/`). */
80
+ function packageRootDir() {
81
+ return path.join(__dirname, "..", "..", "..");
82
+ }
83
+ /** Paths relative to package root → relative to consumer cwd. */
84
+ const USER_ASSET_MANIFEST = [
85
+ { from: path.join("user-assets", "AGENTS.md"), to: "AGENTS.md" },
86
+ { from: path.join("user-assets", "ORQINT.md"), to: "ORQINT.md" },
87
+ {
88
+ from: path.join("user-assets", "cursor-rules", "orqint-workflow.mdc"),
89
+ to: path.join(".cursor", "rules", "orqint-workflow.mdc"),
90
+ },
91
+ ];
92
+ /** Copy shipped user assets; skip existing destinations unless `forceUserAssets`. Returns count copied. */
93
+ async function copyUserAssets(cwd, opts) {
94
+ const pkgRoot = packageRootDir();
95
+ let copied = 0;
96
+ for (const { from: relFrom, to: relTo } of USER_ASSET_MANIFEST) {
97
+ const from = path.join(pkgRoot, relFrom);
98
+ const to = path.join(cwd, relTo);
99
+ if (!(await fs.pathExists(from))) {
100
+ (0, logger_1.log)("warn", "init_user_asset_missing", { from });
101
+ continue;
102
+ }
103
+ const destExists = await fs.pathExists(to);
104
+ const shouldCopy = opts.forceUserAssets || !destExists;
105
+ if (!shouldCopy) {
106
+ (0, logger_1.log)("info", "init_user_asset_skipped_exists", { file: relTo });
107
+ continue;
108
+ }
109
+ await fs.ensureDir(path.dirname(to));
110
+ await fs.copy(from, to, { overwrite: opts.forceUserAssets });
111
+ (0, logger_1.log)("info", "init_user_asset_copied", { file: relTo });
112
+ copied += 1;
113
+ }
114
+ return copied;
115
+ }
73
116
  async function seedFromRepo(cwd, memory) {
74
117
  const pkgPath = path.join(cwd, "package.json");
75
118
  if (await fs.pathExists(pkgPath)) {
@@ -49,7 +49,7 @@ No model API keys in this tool: use Cursor on the generated handoff files, then
49
49
  Commands:
50
50
  orqint version | --version | -V
51
51
  orqint update [--install] [<args>...] check npm; --install runs npx ${name}@latest <args>
52
- orqint init [--brownfield] [--migrate-legacy] [--force]
52
+ orqint init [--brownfield] [--migrate-legacy] [--force] [--force-user-assets]
53
53
  orqint think prepare "<intent>" [--override key=value ...]
54
54
  orqint think apply --file <path>
55
55
  orqint plan prepare [--force]
@@ -126,8 +126,10 @@ async function main() {
126
126
  }
127
127
  if (cmd === "init") {
128
128
  const args = argv.slice(1);
129
+ const forceUserAssets = takeFlag(args, "--force-user-assets");
129
130
  await (0, init_1.runInit)(cwd, {
130
131
  force: takeFlag(args, "--force"),
132
+ forceUserAssets,
131
133
  brownfield: takeFlag(args, "--brownfield"),
132
134
  migrateLegacy: takeFlag(args, "--migrate-legacy"),
133
135
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orqint/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "CLI orchestration for Cursor-native think/plan workflows (Orqint)",
5
5
  "keywords": [
6
6
  "orqint",
@@ -21,7 +21,9 @@
21
21
  "files": [
22
22
  "dist",
23
23
  "README.md",
24
- "AGENTS.md"
24
+ "user-assets/AGENTS.md",
25
+ "user-assets/ORQINT.md",
26
+ "user-assets/cursor-rules/orqint-workflow.mdc"
25
27
  ],
26
28
  "scripts": {
27
29
  "prepublishOnly": "npm run build",
@@ -10,17 +10,11 @@
10
10
 
11
11
  - Follow the JSON schema embedded in each handoff.
12
12
  - Honor `memory.override` from the sliced context.
13
- - No OpenAI (or other) API keys in the Orqint CLI; intelligence for `think`/`plan` runs here in Cursor.
13
+ - No OpenAI (or other) API keys in the Orqint CLI; intelligence for `think`/`plan` runs in Cursor on the handoff files.
14
14
 
15
15
  ## Source of truth
16
16
 
17
17
  - **Canonical:** `orqint/core/memory.json`
18
18
  - **Derived:** `orqint-spec/`
19
19
 
20
- ## Developing the Orqint CLI (this repository)
21
-
22
- - TypeScript: `packages/cli/src/`
23
- - Prompt templates to edit: `packages/cli/prompts/` (built into `dist/orqint/prompts/`)
24
- - **npm `version`:** bump per [docs/PRD/PRD.md](docs/PRD/PRD.md) §17 before each publish; see `.cursor/rules/orqint-versioning.mdc`.
25
-
26
- See [docs/Repository-layout.md](docs/Repository-layout.md), [docs/PRD/PRD.md](docs/PRD/PRD.md), and `.cursor/rules/orqint-workflow.mdc`.
20
+ See **ORQINT.md** in this repository for commands and `init` options. Package: [@orqint/cli on npm](https://www.npmjs.com/package/@orqint/cli).
@@ -0,0 +1,36 @@
1
+ # Orqint — Cursor workflow (your project)
2
+
3
+ Orqint drives **prepare → run in Cursor → apply**: the CLI writes handoff files; you run the Agent in Cursor on those files; you save **strict JSON** responses; the CLI merges into `orqint/core/memory.json`. No API keys are required in the CLI.
4
+
5
+ ## After `orqint init`
6
+
7
+ - **Canonical state:** `orqint/core/memory.json`
8
+ - **Derived docs:** `orqint-spec/`
9
+ - **Handoffs:** `orqint/.handoff/`
10
+
11
+ Read **`AGENTS.md`** in this repository for the short agent checklist (think/plan flow and rules). If `init` added **`.cursor/rules/orqint-workflow.mdc`**, Cursor can use it when you work in handoff files.
12
+
13
+ ## Commands (Phase 1)
14
+
15
+ Use `npx @orqint/cli` or a local/global `orqint` binary the same way.
16
+
17
+ | Step | Command |
18
+ | --- | --- |
19
+ | Think handoff | `orqint think prepare "<your intent>"` |
20
+ | In Cursor | Open `orqint/.handoff/think.md`, run the Agent, write valid JSON to e.g. `orqint/.handoff/think.response.json` |
21
+ | Merge think | `orqint think apply --file orqint/.handoff/think.response.json` |
22
+ | Plan handoff | `orqint plan prepare` |
23
+ | In Cursor | Same pattern → `orqint/.handoff/plan.response.json` |
24
+ | Merge plan | `orqint plan apply --file orqint/.handoff/plan.response.json` |
25
+
26
+ Follow the JSON schema embedded in each handoff file. Honor `memory.override` when the sliced context includes it.
27
+
28
+ ## Optional flags (`init`)
29
+
30
+ - `orqint init --brownfield` — seed `memory.json` hints from `package.json` / `README.md` when present.
31
+ - `orqint init --force` — re-initialize **Orqint runtime** (e.g. `memory.json`, layout). Does **not** overwrite existing **`AGENTS.md`**, **`ORQINT.md`**, or **`.cursor/rules/orqint-workflow.mdc`** in your project.
32
+ - `orqint init --force-user-assets` — refresh those Orqint-shipped files from the package (overwrites the paths above). Use when you want the latest templates from your installed CLI version.
33
+
34
+ ## Package reference
35
+
36
+ Published CLI: [@orqint/cli on npm](https://www.npmjs.com/package/@orqint/cli).
@@ -0,0 +1,18 @@
1
+ ---
2
+ description: Orqint think/plan handoffs — Cursor agent rules (user project)
3
+ globs: orqint/.handoff/**
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Orqint (Phase 1)
8
+
9
+ When the user works with **Orqint handoffs** (`orqint/.handoff/think.md`, `plan.md`):
10
+
11
+ 1. **Read** the handoff file they open; it contains sliced memory, the prompt template, and the **exact JSON schema** for your reply.
12
+ 2. **Output only JSON** matching that schema (no markdown fences unless they ask to save to `.json` — the file on disk must be parseable JSON).
13
+ 3. **Respect `memory.override`** (and any human overrides in the handoff): they override model defaults (e.g. no_supabase, mobile_first).
14
+ 4. **Open questions:** at most **3–5** high-value questions in `open_questions` when confidence is low.
15
+ 5. **Do not** invent API keys or ask the user to put secrets in the repo; Orqint does not use CLI-side model APIs.
16
+ 6. After you produce JSON, the user runs `orqint think apply --file ...` or `orqint plan apply --file ...` — remind them if they forget.
17
+
18
+ For step-by-step usage, see **ORQINT.md** in the project root.