project-mgr 0.1.2 → 0.1.4

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/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.1.4 - 2026-08-03
6
+
7
+ ### Changed
8
+
9
+ - Renamed the Agent Skill from `project-mgr-status` to `project-mgr`.
10
+
11
+ ## 0.1.3 - 2026-08-03
12
+
13
+ ### Added
14
+
15
+ - Packaged the `project-mgr-status` Agent Skill for status ledger operations.
16
+
17
+ ### Fixed
18
+
19
+ - Made the CLI run through npm-created `pmgr` symlinks and corrected the no-install examples.
20
+
5
21
  ## 0.1.2 - 2026-08-03
6
22
 
7
23
  ### Changed
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  `project-mgr` is a local-first, append-only ledger for project status. It stores progress, blockers, decisions, and next steps as timestamped status snapshots, so people and AI agents can quickly inspect each project's current state, complete history, or state at a particular time.
6
6
 
7
- The first release provides only a local CLI and SQLite. It has no HTTP API, long-running service, or agent skills. Data stays on the local machine and requires no account or cloud service.
7
+ The first release provides a local CLI, SQLite, and an optional Agent Skill. It has no HTTP API or long-running service. Data stays on the local machine and requires no account or cloud service.
8
8
 
9
9
  ## Run from npm
10
10
 
@@ -13,7 +13,7 @@ Requires Node.js 22+.
13
13
  Run without installing:
14
14
 
15
15
  ```bash
16
- npx --yes project-mgr current
16
+ npx --yes --package project-mgr pmgr current
17
17
  ```
18
18
 
19
19
  Or install the CLI globally:
@@ -28,9 +28,23 @@ The database defaults to `~/.local/share/project-mgr/project-mgr.sqlite`, regard
28
28
  Set `PMGR_DB_PATH` to use another location:
29
29
 
30
30
  ```bash
31
- PMGR_DB_PATH=/absolute/path/projects.sqlite npx --yes project-mgr current
31
+ PMGR_DB_PATH=/absolute/path/projects.sqlite npx --yes --package project-mgr pmgr current
32
32
  ```
33
33
 
34
+ ## Install the Agent Skill
35
+
36
+ The repository includes `skills/project-mgr`, which guides compatible AI agents to add, import, query, and export status records. Install it with the [skills CLI](https://skills.sh/docs/cli):
37
+
38
+ ```bash
39
+ npx skills add deanplus/project-manager
40
+ ```
41
+
42
+ The installer detects supported agents and asks where to install the skill. No separate `project-mgr` installation is required: the skill runs the CLI through `npx`. Restart or reload the selected agent after installation.
43
+
44
+ The skill uses the same `PMGR_DB_PATH` behavior as the CLI: it defaults to `~/.local/share/project-mgr/project-mgr.sqlite`; set an absolute path to work in another ledger. For manual or exploratory work, use a dedicated database such as `PMGR_DB_PATH=/tmp/project-mgr-skill-test.sqlite` rather than the default ledger.
45
+
46
+ Then ask the agent, for example: `Use project-mgr to add an active status after checking its current status.`
47
+
34
48
  ## Build from source
35
49
 
36
50
  Requires Node.js 22+ and pnpm 10.30.2.
package/README_CN.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  `project-mgr` 是一个本地优先、只追加的项目状态账本。它把项目进展、阻塞、决策和下一步保存为带时间的状态快照,让个人或 AI Agent 能快速查询每个项目的当前状态、完整历史以及某个时间点的状态。
6
6
 
7
- 首版只提供本地 CLI 和 SQLite,不包含 HTTP API、常驻服务或 Agent Skills。数据默认保存在本机,无需账号或云服务。
7
+ 首版提供本地 CLI、SQLite 和可选的 Agent Skill,不包含 HTTP API 或常驻服务。数据默认保存在本机,无需账号或云服务。
8
8
 
9
9
  ## 从 npm 运行
10
10
 
@@ -13,7 +13,7 @@
13
13
  无需安装即可运行:
14
14
 
15
15
  ```bash
16
- npx --yes project-mgr current
16
+ npx --yes --package project-mgr pmgr current
17
17
  ```
18
18
 
19
19
  也可以全局安装 CLI:
@@ -28,9 +28,23 @@ pmgr current
28
28
  通过 `PMGR_DB_PATH` 指定其他位置:
29
29
 
30
30
  ```bash
31
- PMGR_DB_PATH=/absolute/path/projects.sqlite npx --yes project-mgr current
31
+ PMGR_DB_PATH=/absolute/path/projects.sqlite npx --yes --package project-mgr pmgr current
32
32
  ```
33
33
 
34
+ ## 安装 Agent Skill
35
+
36
+ 仓库包含 `skills/project-mgr`,用于指导兼容 Skills 的 AI Agent 新增、导入、查询和导出项目状态记录。通过 [skills CLI](https://skills.sh/docs/cli) 安装:
37
+
38
+ ```bash
39
+ npx skills add deanplus/project-manager
40
+ ```
41
+
42
+ 安装器会检测支持的 Agent,并询问安装目标。无需单独安装 `project-mgr`:该 Skill 会通过 `npx` 运行 CLI。安装后重启或重新加载所选 Agent。
43
+
44
+ 该 Skill 与 CLI 使用相同的 `PMGR_DB_PATH` 规则:默认使用 `~/.local/share/project-mgr/project-mgr.sqlite`;如需使用其他账本,请设置绝对路径。手工或探索性操作请使用独立数据库,例如 `PMGR_DB_PATH=/tmp/project-mgr-skill-test.sqlite`,避免写入默认账本。
45
+
46
+ 随后可向 Agent 提出,例如:`使用 project-mgr,在查询当前状态后新增一条 active 状态。`
47
+
34
48
  ## 从源码构建
35
49
 
36
50
  需要 Node.js 22+ 和 pnpm 10.30.2。
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { readFileSync } from "node:fs";
3
- import { basename, resolve } from "node:path";
2
+ import { readFileSync, realpathSync } from "node:fs";
3
+ import { basename } from "node:path";
4
4
  import { pathToFileURL } from "node:url";
5
5
  import { addStatus, at, current, history, importStatuses, openLedger, parseTime, toPortableStatusEntry, ValidationError, } from "./index.js";
6
6
  const repeats = new Set(["next", "blocker", "decision", "tag"]);
@@ -201,7 +201,7 @@ export function run(argv, write = process.stdout.write.bind(process.stdout)) {
201
201
  }
202
202
  /* c8 ignore start -- process entry glue is covered by the CLI integration tests through run(). */
203
203
  if (process.argv[1] &&
204
- import.meta.url === pathToFileURL(resolve(process.argv[1])).href) {
204
+ import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href) {
205
205
  try {
206
206
  run(process.argv.slice(2));
207
207
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "project-mgr",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Local-first append-only project status ledger",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: project-mgr
3
+ description: Manage project status with the local-first project-mgr CLI. Use when an AI agent needs to add an append-only project update, import status records, query current or historical project state, or export a status ledger.
4
+ ---
5
+
6
+ # Project Mgr
7
+
8
+ Use `npx --yes --package project-mgr pmgr`. In a source checkout, use `pnpm pmgr` instead.
9
+
10
+ ## Database safety
11
+
12
+ - Read `PMGR_DB_PATH` before operating. If unset, the CLI uses `~/.local/share/project-mgr/project-mgr.sqlite`.
13
+ - For exploratory or test work, set `PMGR_DB_PATH` to a dedicated absolute SQLite path for every command. Do not use `:memory:` when more than one CLI invocation must share data.
14
+ - Query before writing. `add` appends a snapshot; it does not edit the previous one.
15
+ - Set `--source agent` for agent-authored updates. Use `--external-ref` only when a stable idempotency key is available.
16
+
17
+ ## Operations
18
+
19
+ Prefer `--json` for data that must be interpreted or reported programmatically.
20
+
21
+ ```bash
22
+ # Add an agent-authored status snapshot.
23
+ npx --yes --package project-mgr pmgr add --project my-project --status active --summary "Implemented the CLI" \
24
+ --progress "Tests pass" --next "Publish the package" --source agent --json
25
+
26
+ # Query current state, history, or state at a time.
27
+ npx --yes --package project-mgr pmgr current --project my-project --json
28
+ npx --yes --package project-mgr pmgr history --project my-project --limit 20 --json
29
+ npx --yes --package project-mgr pmgr at --project my-project --at 2026-08-03T12:00:00+08:00 --json
30
+
31
+ # Import validated JSON/JSONL, or export portable records.
32
+ npx --yes --package project-mgr pmgr import statuses.jsonl --json
33
+ npx --yes --package project-mgr pmgr export --project my-project --format jsonl > statuses.jsonl
34
+ ```
35
+
36
+ Use `PMGR_DB_PATH=/absolute/path/test.sqlite npx --yes --package project-mgr pmgr ...` to isolate a manual test database. Import validates the entire batch before one transaction writes it; export output can be imported directly.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Project Manager"
3
+ short_description: "Manage local project status records safely"
4
+ default_prompt: "Use $project-mgr to add and inspect this project status."
package/src/cli.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { readFileSync } from "node:fs";
3
- import { basename, resolve } from "node:path";
2
+ import { readFileSync, realpathSync } from "node:fs";
3
+ import { basename } from "node:path";
4
4
  import { pathToFileURL } from "node:url";
5
5
  import {
6
6
  addStatus,
@@ -260,7 +260,7 @@ export function run(
260
260
  /* c8 ignore start -- process entry glue is covered by the CLI integration tests through run(). */
261
261
  if (
262
262
  process.argv[1] &&
263
- import.meta.url === pathToFileURL(resolve(process.argv[1])).href
263
+ import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href
264
264
  ) {
265
265
  try {
266
266
  run(process.argv.slice(2));
package/test/core.test.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  import assert from "node:assert/strict";
2
- import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
2
+ import { spawnSync } from "node:child_process";
3
+ import { mkdtempSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
3
4
  import { homedir, tmpdir } from "node:os";
4
5
  import { join } from "node:path";
5
6
  import test from "node:test";
7
+ import { fileURLToPath } from "node:url";
6
8
  import { run } from "../src/cli.js";
7
9
  import {
8
10
  addStatus,
@@ -187,6 +189,26 @@ test("database path has a stable default and environment override creates its pa
187
189
  rmSync(directory, { recursive: true, force: true });
188
190
  });
189
191
 
192
+ test("CLI runs through a package-style symlink", () => {
193
+ const directory = mkdtempSync(join(tmpdir(), "pmgr-bin-"));
194
+ const executable = join(directory, "pmgr");
195
+ symlinkSync(
196
+ fileURLToPath(new URL("../src/cli.ts", import.meta.url)),
197
+ executable,
198
+ );
199
+ const result = spawnSync(
200
+ process.execPath,
201
+ ["--import", "tsx", executable, "current", "--json"],
202
+ {
203
+ encoding: "utf8",
204
+ env: { ...process.env, PMGR_DB_PATH: ":memory:" },
205
+ },
206
+ );
207
+ assert.equal(result.status, 0, result.stderr);
208
+ assert.equal(result.stdout, "[]\n");
209
+ rmSync(directory, { recursive: true, force: true });
210
+ });
211
+
190
212
  test("CLI supports add, import, reads, errors, and export formats", () => {
191
213
  const directory = mkdtempSync(join(tmpdir(), "pmgr-cli-"));
192
214
  const file = join(directory, "ledger.sqlite");