starlists

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Starlists

Starlists

Prefer the installed
stars
binary on PATH. Use
--json
when reading output. SQLite is local truth. GitHub Lists change only on
apply --confirm
.
优先使用PATH中已安装的
stars
二进制文件。读取输出时使用
--json
参数。SQLite为本地数据源。仅在执行
apply --confirm
时才会更改GitHub Lists。

First commands

初始命令

bash
command -v stars
stars --json doctor
stars init
Auth:
GITHUB_TOKEN
/
GH_TOKEN
/
STARS_GITHUB_TOKEN
/
gh auth token
. List writes need
user
scope (
gh auth refresh -h github.com -s user
).
Database default:
~/.local/share/stars/stars.db
. Config:
~/.config/stars/config.toml
. Proposal schema: https://github.com/chuxubank/starlists/blob/main/schema/proposal.v1.json
bash
command -v stars
stars --json doctor
stars init
认证:支持
GITHUB_TOKEN
/
GH_TOKEN
/
STARS_GITHUB_TOKEN
/
gh auth token
。列表写入需要
user
权限范围(执行
gh auth refresh -h github.com -s user
获取)。
数据库默认路径:
~/.local/share/stars/stars.db
。配置文件路径:
~/.config/stars/config.toml
。提议 schema:https://github.com/chuxubank/starlists/blob/main/schema/proposal.v1.json

Safe read path

安全读取流程

bash
stars snapshot
stars --json lists
stars --json repos list --unlisted --limit 50
stars --json repos show owner/repo
stars export --for-agent --out /tmp/stars-corpus.json
snapshot
is a network read. It updates the local DB. It does not write Lists.
bash
stars snapshot
stars --json lists
stars --json repos list --unlisted --limit 50
stars --json repos show owner/repo
stars export --for-agent --out /tmp/stars-corpus.json
snapshot
是网络读取操作,会更新本地数据库,但不会写入Lists。

Classify

分类流程

  1. Export corpus (
    export --for-agent
    ).
  2. Write
    proposal.json
    matching
    schema/proposal.v1.json
    . A repo may have multiple list slugs. Prefer existing slugs. Create a list only for a real cluster (about 4+ repos). Do not split by programming language. Keep live GitHub lists around 20–28 (cap 32).
  3. Import locally:
bash
stars --json propose import proposal.json
stars --json plan show
Stop after import. Do not write GitHub from the classifier.
  1. 导出语料库(使用
    export --for-agent
    参数)。
  2. 编写符合
    schema/proposal.v1.json
    格式的
    proposal.json
    文件。一个仓库可对应多个列表slug,优先使用现有slug。仅当存在实际集群(约4个及以上仓库)时才创建新列表。请勿按编程语言拆分列表。保持GitHub上的活跃列表数量在20–28个左右(上限32个)。
  3. 本地导入:
bash
stars --json propose import proposal.json
stars --json plan show
导入后停止操作,不要从分类器写入GitHub。

Write path

写入流程

Needs explicit user approval.
bash
stars apply --plan PLAN_…
stars apply --plan PLAN_… --confirm
Without
--confirm
this is a dry-run. Pass
--confirm
or
request --write
only when the user asked to mutate GitHub.
Local-only edits:
bash
stars lists create "Web Mapping" --desc "…"
stars assign owner/repo --add web-mapping --add emacs
updateUserListsForItem
replaces a repo's entire list set. Apply always sends the full set. List deletes run after membership updates.
需要用户明确批准。
bash
stars apply --plan PLAN_…
stars apply --plan PLAN_… --confirm
不带
--confirm
参数时为试运行。仅当用户要求修改GitHub时,才添加
--confirm
request --write
参数。
仅本地编辑:
bash
stars lists create "Web Mapping" --desc "…"
stars assign owner/repo --add web-mapping --add emacs
updateUserListsForItem
会替换仓库的整个列表集合。Apply操作始终发送完整集合。列表删除操作在成员资格更新后执行。

Raw hatch

原始查询

bash
stars --json request --query 'query { viewer { login } }'
Mutations require
--write
.
bash
stars --json request --query 'query { viewer { login } }'
修改操作需要添加
--write
参数。

Emacs

Emacs集成

--sexp
prints
data
as an s-expression. Call the same binary.
--sexp
参数会将
data
以s表达式格式输出。调用同一个二进制文件即可。