iterate 0.2.5 → 0.2.6

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,58 +1,52 @@
1
1
  # iterate
2
2
 
3
- ⚠️⚠️⚠️ Coming soon! `npx iterate` is a work-in-progress CLI for managing [iterate.com](https://iterate.com) agents ⚠️⚠️⚠️
4
-
5
3
  CLI for Iterate.
6
4
 
7
- Runs as a thin bootstrapper that:
5
+ `npx iterate` opens the Iterate chat terminal UI. It is equivalent to
6
+ `npx iterate chat`.
8
7
 
9
- 1. Resolves an `iterate/iterate` checkout.
10
- 2. Clones/install deps when needed.
11
- 3. Loads `apps/os/backend/trpc/root.ts` from that checkout.
12
- 4. Exposes commands like `iterate os ...` and `iterate whoami`.
8
+ The package also runs as a thin bootstrapper: inside this repo it delegates to
9
+ the local `packages/iterate` source, and from npm it runs the published build.
13
10
 
14
11
  ## Requirements
15
12
 
16
13
  - Node `>=22`
17
- - `git`
18
- - `pnpm` or `corepack`
14
+ - Bun, for the current OpenTUI-based chat terminal runtime
19
15
 
20
16
  ## Quick start
21
17
 
22
18
  Run without installing globally:
23
19
 
24
20
  ```bash
25
- npx iterate --help
21
+ npx iterate
26
22
  ```
27
23
 
28
- Initial setup (writes auth + launcher config):
24
+ If you are not logged in yet, `iterate chat` starts the browser OAuth flow. The
25
+ auth flow asks for project access and can create your first organization and
26
+ project before returning to the CLI.
29
27
 
30
28
  ```bash
31
- npx iterate setup \
32
- --os-base-url https://dev-yourname-os.dev.iterate.com \
33
- --daemon-base-url http://localhost:3001 \
34
- --admin-password-env-var-name SERVICE_AUTH_TOKEN \
35
- --user-email dev-yourname@iterate.com \
36
- --scope global
29
+ npx iterate chat
37
30
  ```
38
31
 
39
- Then run commands:
32
+ For help and other commands:
40
33
 
41
34
  ```bash
42
- npx iterate whoami
43
- npx iterate os project list
35
+ npx iterate --help
36
+ npx iterate login
37
+ npx iterate orgs list
38
+ npx iterate config list
44
39
  ```
45
40
 
46
41
  ## Commands
47
42
 
48
- - `iterate setup` - configure auth + launcher defaults
49
- - `iterate doctor` - print resolved config/runtime info
50
- - `iterate install` - force clone/install for resolved checkout
51
- - `iterate whoami`
43
+ - `iterate` - open chat
44
+ - `iterate chat` - open the Iterate agent chat terminal UI
45
+ - `iterate login` - authenticate with browser-based OAuth
46
+ - `iterate logout` - remove the stored session for the current config
47
+ - `iterate orgs list`
48
+ - `iterate config ...`
52
49
  - `iterate os ...`
53
- - `iterate daemon ...`
54
-
55
- `setup --scope global` writes auth + launcher values into `global`; `setup --scope workspace` writes them into `workspaces[process.cwd()]`.
56
50
 
57
51
  ## Config file
58
52
 
@@ -64,71 +58,40 @@ Config shape:
64
58
 
65
59
  ```json
66
60
  {
67
- "global": {
68
- "repoPath": "~/.local/share/iterate/repo",
69
- "repoRef": "main",
70
- "repoUrl": "https://github.com/iterate/iterate.git",
71
- "autoInstall": true
61
+ "configs": {
62
+ "default": {
63
+ "osBaseUrl": "https://os.iterate.com",
64
+ "authBaseUrl": "https://auth.iterate.com",
65
+ "defaultProject": "my-project"
66
+ },
67
+ "dev": {
68
+ "osBaseUrl": "http://localhost:54896",
69
+ "authBaseUrl": "http://localhost:7101"
70
+ }
72
71
  },
72
+ "default": "default",
73
73
  "workspaces": {
74
- "/absolute/workspace/path": {
75
- "osBaseUrl": "https://dev-yourname-os.dev.iterate.com",
76
- "daemonBaseUrl": "http://localhost:3001",
77
- "adminPasswordEnvVarName": "SERVICE_AUTH_TOKEN",
78
- "userEmail": "dev-yourname@iterate.com"
79
- }
74
+ "/absolute/workspace/path": "dev"
80
75
  }
81
76
  }
82
77
  ```
83
78
 
84
- Merge precedence is shallow:
85
-
86
- `global` -> `workspaces[process.cwd()]`
87
-
88
- ## Repo checkout resolution
89
-
90
- `repoPath` resolution order:
91
-
92
- 1. `ITERATE_REPO_DIR`
93
- 2. `workspaces[process.cwd()].repoPath`
94
- 3. `global.repoPath`
95
- 4. nearest parent directory containing `.git`, `pnpm-workspace.yaml`, and `apps/os/backend/trpc/root.ts`
96
- 5. default managed checkout path `${XDG_DATA_HOME:-~/.local/share}/iterate/repo`
97
-
98
- `repoPath` shortcuts in `setup`:
99
-
100
- - `local` - nearest local iterate checkout
101
- - `managed` - default managed checkout path
102
-
103
- Environment overrides:
104
-
105
- - `ITERATE_REPO_DIR`
106
- - `ITERATE_REPO_REF`
107
- - `ITERATE_REPO_URL`
108
- - `ITERATE_AUTO_INSTALL` (`1/true` or `0/false`)
79
+ Config resolution priority: `--config` flag > workspace match (walk up from cwd) > `default` key > single-config auto-select.
109
80
 
110
81
  ## Local iterate dev
111
82
 
112
- If you run inside an `iterate/iterate` clone, the CLI auto-detects it. In that mode, default `autoInstall` is `false`.
113
-
114
- You can pin explicitly:
115
-
116
- ```bash
117
- npx iterate setup \
118
- --os-base-url https://dev-yourname-os.dev.iterate.com \
119
- --daemon-base-url http://localhost:3001 \
120
- --admin-password-env-var-name SERVICE_AUTH_TOKEN \
121
- --user-email dev-yourname@iterate.com \
122
- --scope workspace
123
- ```
83
+ If you run inside an `iterate/iterate` clone, the CLI auto-detects it and
84
+ delegates to the local source instead of the published build.
124
85
 
125
86
  ## Publishing (maintainers)
126
87
 
127
88
  From repo root:
128
89
 
129
90
  ```bash
91
+ pnpm --filter ./packages/iterate build
130
92
  pnpm --filter ./packages/iterate typecheck
131
- pnpm eslint packages/iterate/bin/iterate.js
132
- pnpm prettier --check packages/iterate
93
+ pnpm --filter ./packages/iterate test
94
+ pnpm exec oxlint packages/iterate/src/cli.ts packages/iterate/src/cli.test.ts
95
+ pnpm exec oxfmt --check packages/iterate
133
96
  pnpm --filter ./packages/iterate publish --access public
134
97
  ```
package/bin/iterate.js CHANGED
@@ -45,7 +45,7 @@ const findLocalModule = () => {
45
45
  // Prefer TS source in monorepo dev, fall back to dist
46
46
  const repoSrc = join(repoPkg, "src/index.ts");
47
47
  if (existsSync(repoSrc)) return repoSrc;
48
- const repoDist = join(repoPkg, "dist/index.js");
48
+ const repoDist = join(repoPkg, "dist/index.mjs");
49
49
  if (existsSync(repoDist)) return repoDist;
50
50
  }
51
51
  }
@@ -56,7 +56,7 @@ const findLocalModule = () => {
56
56
  const nmScript = join(nmRoot, "node_modules/.bin/iterate");
57
57
  if (existsSync(nmScript) && realpathSync(nmScript) !== selfReal) {
58
58
  // Published package — use dist
59
- const nmDist = join(nmRoot, "node_modules/iterate/dist/index.js");
59
+ const nmDist = join(nmRoot, "node_modules/iterate/dist/index.mjs");
60
60
  if (existsSync(nmDist)) return nmDist;
61
61
  }
62
62
  }
@@ -70,9 +70,9 @@ if (localModule) {
70
70
  await runCli();
71
71
  } else {
72
72
  // No delegation — run our own copy.
73
- // In monorepo dev: src/index.ts exists. Published: dist/index.js exists.
73
+ // In monorepo dev: src/index.ts exists. Published: dist/index.mjs exists.
74
74
  const srcPath = join(pkgRoot, "src/index.ts");
75
- const distPath = join(pkgRoot, "dist/index.js");
75
+ const distPath = join(pkgRoot, "dist/index.mjs");
76
76
  const modulePath = existsSync(srcPath) ? srcPath : distPath;
77
77
  const { runCli } = await import(modulePath);
78
78
  await runCli();