t3code-cli 0.5.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.
Files changed (112) hide show
  1. package/README.md +41 -16
  2. package/dist/Context-DueQ9iMH.js +4916 -0
  3. package/dist/Path-D8WPdPwR.js +11406 -0
  4. package/dist/Schema-DsQxYh6_.js +13581 -0
  5. package/dist/UrlParams-BA6gBvaY.js +205 -0
  6. package/dist/application.js +2 -0
  7. package/dist/auth.js +3 -0
  8. package/dist/base-dir-R12OMDso.js +20 -0
  9. package/dist/bin.js +236 -13526
  10. package/dist/chunk-B5meny8j.js +36 -0
  11. package/dist/cli.js +2 -0
  12. package/dist/config.js +4 -0
  13. package/dist/connection.js +15 -0
  14. package/dist/contracts.js +1 -0
  15. package/dist/error-B2t1bAP9.js +169 -0
  16. package/dist/error-BHRnjLux.js +15 -0
  17. package/dist/error-jwMt3VoW.js +54 -0
  18. package/dist/flags-CM7_iGdA.js +13371 -0
  19. package/dist/index.js +5 -12
  20. package/dist/layer-CfC5qZol.js +1508 -0
  21. package/dist/layer-DHhKS5jd.js +13 -0
  22. package/dist/layer-DUv99vsS.js +72 -0
  23. package/dist/layer-DvHnKBYj.js +29466 -0
  24. package/dist/layer-MqCKkIGD.js +1206 -0
  25. package/dist/layout.js +2 -0
  26. package/dist/orchestration.js +2 -0
  27. package/dist/rpc.js +2 -0
  28. package/dist/runtime.js +3 -0
  29. package/dist/scope-GycYiJ54.js +29 -0
  30. package/dist/scope.js +2 -0
  31. package/dist/service-CLmRO2Dp.js +8 -0
  32. package/dist/service-ybOWV9pL.js +5 -0
  33. package/dist/src/application/index.d.ts +3 -0
  34. package/dist/src/application/layer.d.ts +4 -4
  35. package/dist/src/application/projects.d.ts +1 -1
  36. package/dist/src/application/service.d.ts +1 -1
  37. package/dist/src/application/threads.d.ts +4 -4
  38. package/dist/src/auth/index.d.ts +10 -0
  39. package/dist/src/auth/local-base-dir.d.ts +5 -7
  40. package/dist/src/auth/local-token.d.ts +2 -2
  41. package/dist/src/auth/type.d.ts +1 -0
  42. package/dist/src/cli/flags.d.ts +15 -0
  43. package/dist/src/cli/index.d.ts +1 -0
  44. package/dist/src/cli/output-format.d.ts +9 -0
  45. package/dist/src/config/index.d.ts +5 -0
  46. package/dist/src/config/layer.d.ts +2 -0
  47. package/dist/src/config/service.d.ts +2 -0
  48. package/dist/src/connection/index.d.ts +5 -0
  49. package/dist/src/contracts/index.d.ts +1 -0
  50. package/dist/src/domain/helpers.d.ts +163 -32
  51. package/dist/src/index.d.ts +4 -28
  52. package/dist/src/layout/base-dir.d.ts +12 -0
  53. package/dist/src/layout/index.d.ts +1 -0
  54. package/dist/src/orchestration/index.d.ts +2 -0
  55. package/dist/src/rpc/index.d.ts +1 -0
  56. package/dist/src/runtime/index.d.ts +2 -0
  57. package/dist/src/runtime/layer.d.ts +11 -0
  58. package/dist/src/scope/index.d.ts +1 -0
  59. package/dist/src/scope/resolve.d.ts +19 -0
  60. package/dist/src/t3tools/index.d.ts +1 -0
  61. package/dist/src-KdbHqrex.js +8874 -0
  62. package/dist/t3tools.js +2 -0
  63. package/dist/transport-D3zBdZ1h.js +539 -0
  64. package/dist/url-SlsaG8nY.js +165 -0
  65. package/package.json +54 -2
  66. package/src/application/index.ts +3 -0
  67. package/src/application/service.ts +1 -1
  68. package/src/application/threads.ts +38 -11
  69. package/src/auth/index.ts +28 -0
  70. package/src/auth/layer.ts +13 -6
  71. package/src/auth/local-base-dir.ts +15 -19
  72. package/src/auth/local-origin.ts +4 -1
  73. package/src/auth/local-token.ts +4 -1
  74. package/src/auth/type.ts +1 -0
  75. package/src/bin.ts +1 -1
  76. package/src/cli/app.ts +6 -6
  77. package/src/cli/auth-format.ts +2 -0
  78. package/src/cli/auth.ts +19 -9
  79. package/src/cli/error.ts +7 -0
  80. package/src/cli/flags.ts +51 -0
  81. package/src/cli/index.ts +10 -0
  82. package/src/cli/{models.ts → model.ts} +5 -4
  83. package/src/cli/{projects.ts → project.ts} +8 -7
  84. package/src/cli/require.ts +31 -0
  85. package/src/cli/{threads.ts → thread.ts} +2 -2
  86. package/src/cli/threads/archive.ts +24 -8
  87. package/src/cli/threads/list.ts +12 -5
  88. package/src/cli/threads/messages.ts +20 -5
  89. package/src/cli/threads/send.ts +27 -23
  90. package/src/cli/threads/start.ts +22 -21
  91. package/src/cli/threads/wait.ts +22 -12
  92. package/src/config/index.ts +5 -0
  93. package/src/config/layer.ts +2 -0
  94. package/src/config/service.ts +2 -0
  95. package/src/connection/index.ts +9 -0
  96. package/src/contracts/index.ts +8 -0
  97. package/src/domain/helpers.test.ts +103 -0
  98. package/src/domain/helpers.ts +112 -16
  99. package/src/index.ts +4 -87
  100. package/src/layout/base-dir.ts +35 -0
  101. package/src/layout/index.ts +1 -0
  102. package/src/orchestration/index.ts +7 -0
  103. package/src/rpc/index.ts +1 -0
  104. package/src/runtime/index.ts +12 -0
  105. package/src/{runtime.ts → runtime/layer.ts} +15 -15
  106. package/src/scope/index.ts +6 -0
  107. package/src/scope/resolve.ts +62 -0
  108. package/src/t3tools/index.ts +1 -0
  109. package/dist/runtime-KQVRmRk-.js +0 -71499
  110. package/dist/src/connection.d.ts +0 -5
  111. package/dist/src/runtime.d.ts +0 -10
  112. package/src/connection.ts +0 -9
package/README.md CHANGED
@@ -10,46 +10,71 @@ npm install --global t3code-cli
10
10
 
11
11
  This installs the `t3cli` command.
12
12
 
13
+ ## agent skill
14
+
15
+ This repo includes an agent skill for operating `t3cli`: [`skills/t3code-cli/SKILL.md`](skills/t3code-cli/SKILL.md).
16
+
17
+ Install it with [skills](https://skills.sh/):
18
+
19
+ ```sh
20
+ npx skills add tarik02/t3cli
21
+ ```
22
+
13
23
  ## authenticate
14
24
 
15
25
  ```sh
16
- t3cli auth pair <url>
26
+ t3cli auth pair --url <url> [--local]
17
27
  t3cli auth local [--base-dir <path>] [--origin <url>] [--role owner|client] [--label <label>] [--subject <subject>]
18
28
  t3cli auth status
19
29
  ```
20
30
 
21
- Use `auth pair` with a pairing URL from a running t3code server, or `auth local` to authenticate against a local t3code installation.
31
+ Use `auth pair` with a pairing URL from a running t3code server, or `auth local` to authenticate against a local t3code installation. Local auth (`auth local` or `auth pair --local`) enables automatic project resolution from the current directory.
22
32
 
23
- ## projects
33
+ ## project
24
34
 
25
35
  ```sh
26
- t3cli projects list
27
- t3cli projects add <path> [--title <title>]
36
+ t3cli project list
37
+ t3cli project add [--path <path>] [--title <title>]
28
38
  ```
29
39
 
30
- `projects list` shows known projects. `projects add` registers a project path with the server.
40
+ `project list` shows known projects. `project add` registers a project path with the server. `--path` defaults to the current directory.
31
41
 
32
- ## models
42
+ ## model
33
43
 
34
44
  ```sh
35
- t3cli models list [--all] [--provider <provider>]
45
+ t3cli model list [--all] [--provider <provider>]
36
46
  ```
37
47
 
38
48
  Lists available provider models. Use `--all` to include hidden or unavailable entries when the server exposes them.
39
49
 
40
- ## threads
50
+ ## thread
41
51
 
42
52
  ```sh
43
- t3cli threads list <project>
44
- t3cli threads start <project> [message] [--stdin] [--title <title>] [--worktree <path>] [--provider <provider>] [--model <model>] [--option <key=value>] [--reasoning-effort <value>] [--effort <value>] [--fast-mode] [--thinking] [--wait]
45
- t3cli threads send <thread> [message] [--stdin] [--option <key=value>] [--reasoning-effort <value>] [--effort <value>] [--fast-mode] [--thinking] [--wait]
46
- t3cli threads messages <thread> [--limit <count>] [--full]
47
- t3cli threads wait <thread>
48
- t3cli threads archive <thread>
53
+ t3cli thread list [--project <ref>]
54
+ t3cli thread start [message] [--project <ref>] [--stdin] [--title <title>] [--worktree <path>] [--provider <provider>] [--model <model>] [--option <key=value>] [--reasoning-effort <value>] [--effort <value>] [--fast-mode] [--thinking] [--wait]
55
+ t3cli thread send [--thread <id>] [message] [--stdin] [--option <key=value>] [--reasoning-effort <value>] [--effort <value>] [--fast-mode] [--thinking] [--wait]
56
+ t3cli thread messages [--thread <id>] [--limit <count>] [--full]
57
+ t3cli thread wait [--thread <id>]
58
+ t3cli thread archive [--thread <id>]
49
59
  ```
50
60
 
61
+ `--project` accepts a project id or path. When omitted, the CLI resolves the project from the current directory only for local auth (`auth local` or `auth pair --local`). Resolution checks a registered `workspaceRoot`, paths under it, and known thread `worktreePath` values from the server snapshot. Remote pairings require an explicit `--project` or `T3CODE_PROJECT_*` env var. `thread start` infers the worktree from cwd unless `--worktree` or `T3CODE_WORKTREE_PATH` is set.
62
+
63
+ Thread-targeting commands accept `--thread` or fall back to `T3CODE_THREAD_ID`.
64
+
51
65
  Use `--stdin` when the message should be read from standard input instead of an argument. Use `--wait` to stream until the thread pauses.
52
66
 
67
+ ## environment fallbacks
68
+
69
+ When flags are omitted, the CLI reads these variables (first match wins within each group):
70
+
71
+ | Variable | Used by |
72
+ | ---------------------- | ----------------------------------------- |
73
+ | `T3CODE_PROJECT_ROOT` | `--project` |
74
+ | `T3CODE_PROJECT_ID` | `--project` (after `T3CODE_PROJECT_ROOT`) |
75
+ | `T3CODE_WORKTREE_PATH` | `--worktree` |
76
+ | `T3CODE_THREAD_ID` | `--thread` |
77
+
53
78
  ## output
54
79
 
55
80
  Most commands support:
@@ -58,7 +83,7 @@ Most commands support:
58
83
  --format auto|human|json
59
84
  ```
60
85
 
61
- Thread start/send commands also support `--format ndjson`; `threads wait` supports `--format human|ndjson`.
86
+ Thread start/send commands also support `--format ndjson`; `thread wait` supports `--format human|ndjson`.
62
87
 
63
88
  Global flags:
64
89