@iruidong/code 0.1.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 (4) hide show
  1. package/QUICKSTART.md +119 -0
  2. package/README.md +127 -0
  3. package/dist/cli.js +341020 -0
  4. package/package.json +128 -0
package/QUICKSTART.md ADDED
@@ -0,0 +1,119 @@
1
+ # Ruidong Code Quick Start
2
+
3
+ ## 1. Install
4
+
5
+ ```bash
6
+ npm install -g @iruidong/code
7
+ ruidong --version
8
+ ```
9
+
10
+ Expected output:
11
+
12
+ ```bash
13
+ Ruidong Code v0.1.0
14
+ ```
15
+
16
+ ## 2. Prepare your key
17
+
18
+ Ruidong Code can store a direct secret in config, but the recommended path is an environment variable:
19
+
20
+ ```bash
21
+ export RUIDONG_API_KEY="your_api_key"
22
+ ```
23
+
24
+ ## 3. Initialize provider config
25
+
26
+ ### Option A: Wizard
27
+
28
+ ```bash
29
+ ruidong init
30
+ ```
31
+
32
+ Use this if you want Ruidong Code to guide you through endpoint, key env name, and model selection.
33
+
34
+ ### Option B: Preset profile
35
+
36
+ `iruidong`:
37
+
38
+ ```bash
39
+ ruidong init --force --profile iruidong
40
+ ```
41
+
42
+ `crs`:
43
+
44
+ ```bash
45
+ ruidong init --force --profile crs
46
+ ```
47
+
48
+ ### Option C: Custom gateway
49
+
50
+ ```bash
51
+ ruidong init --force \
52
+ --provider anthropic-compatible \
53
+ --base-url https://your-gateway.example/v1 \
54
+ --key-env RUIDONG_API_KEY \
55
+ --model qwen
56
+ ```
57
+
58
+ If you do not know the model ID yet, omit `--model`. After startup you can choose one with `/model`.
59
+
60
+ ## 4. Verify headless mode
61
+
62
+ ```bash
63
+ ruidong -p "你好,请只回复 OK" --bare
64
+ ```
65
+
66
+ If your config already contains a default model, this should return a short response immediately.
67
+
68
+ If your gateway requires an explicit model:
69
+
70
+ ```bash
71
+ ruidong -p "你好,请只回复 OK" --bare --model glm
72
+ ```
73
+
74
+ ## 5. Start an interactive session
75
+
76
+ ```bash
77
+ cd /path/to/project
78
+ ruidong
79
+ ```
80
+
81
+ Useful first commands:
82
+
83
+ ```text
84
+ /model
85
+ /init
86
+ /mcp
87
+ /plugin
88
+ ```
89
+
90
+ ## 6. Project instruction files
91
+
92
+ Ruidong Code uses:
93
+
94
+ - `Ruidong.md` for shared repository instructions
95
+ - `Ruidong.local.md` for local private instructions
96
+
97
+ Legacy `CLAUDE.md` names are still supported for compatibility.
98
+
99
+ ## 7. Common troubleshooting
100
+
101
+ Auth errors:
102
+
103
+ ```bash
104
+ echo $RUIDONG_API_KEY
105
+ cat ~/.ruidong-code/config.json
106
+ ruidong doctor
107
+ ```
108
+
109
+ Need to rebuild config:
110
+
111
+ ```bash
112
+ ruidong init --force
113
+ ```
114
+
115
+ Need more debug output:
116
+
117
+ ```bash
118
+ ruidong -p "test" --bare --debug-to-stderr
119
+ ```
package/README.md ADDED
@@ -0,0 +1,127 @@
1
+ # Ruidong Code
2
+
3
+ Ruidong Code is a terminal coding assistant CLI that works with Anthropic-compatible gateways and relay services. You can point it at your own API URL, choose a default model, and keep runtime settings in `~/.ruidong-code/config.json`.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g @iruidong/code
9
+ ruidong --version
10
+ ```
11
+
12
+ Node.js `>=18` is required.
13
+
14
+ ## Quick Start
15
+
16
+ ### 1. Set your API key
17
+
18
+ ```bash
19
+ export RUIDONG_API_KEY="your_api_key"
20
+ ```
21
+
22
+ ### 2. Initialize config
23
+
24
+ Interactive wizard:
25
+
26
+ ```bash
27
+ ruidong init
28
+ ```
29
+
30
+ Preset profiles:
31
+
32
+ ```bash
33
+ ruidong init --force --profile iruidong
34
+ ruidong init --force --profile crs
35
+ ```
36
+
37
+ Custom gateway:
38
+
39
+ ```bash
40
+ ruidong init --force \
41
+ --provider anthropic-compatible \
42
+ --base-url https://your-gateway.example/v1 \
43
+ --key-env RUIDONG_API_KEY
44
+ ```
45
+
46
+ ### 3. Start using it
47
+
48
+ Interactive session:
49
+
50
+ ```bash
51
+ cd /path/to/project
52
+ ruidong
53
+ ```
54
+
55
+ Non-interactive check:
56
+
57
+ ```bash
58
+ ruidong -p "你好,请只回复 OK" --bare
59
+ ```
60
+
61
+ ## Config Model
62
+
63
+ Ruidong Code stores runtime config in:
64
+
65
+ ```bash
66
+ ~/.ruidong-code/config.json
67
+ ```
68
+
69
+ Common provider fields:
70
+
71
+ ```json
72
+ {
73
+ "provider": {
74
+ "id": "anthropic-compatible",
75
+ "baseUrl": "https://your-gateway.example/v1",
76
+ "authToken": "env:RUIDONG_API_KEY",
77
+ "authMode": "auto",
78
+ "defaultModel": "glm"
79
+ }
80
+ }
81
+ ```
82
+
83
+ Supported init flows:
84
+
85
+ - `iruidong`: built-in preset for `https://iruidong.com`
86
+ - `crs`: built-in preset for the CRS relay profile
87
+ - `anthropic-compatible`: generic gateway mode
88
+
89
+ ## Instruction Files
90
+
91
+ Project instruction files now use:
92
+
93
+ - `Ruidong.md`: shared project instructions
94
+ - `Ruidong.local.md`: local private instructions
95
+
96
+ Legacy `CLAUDE.md` and `CLAUDE.local.md` are still read for compatibility.
97
+
98
+ ## Useful Commands
99
+
100
+ ```bash
101
+ ruidong --help
102
+ ruidong init --help
103
+ ruidong -p "summarize this repo" --bare
104
+ ruidong doctor
105
+ ```
106
+
107
+ Inside an interactive session:
108
+
109
+ - `/model`
110
+ - `/init`
111
+ - `/mcp`
112
+ - `/plugin`
113
+
114
+ ## Docs
115
+
116
+ - [Quick Start](./QUICKSTART.md)
117
+ - [双平台配置说明](./docs/PLATFORM_SPLIT_CN.md)
118
+
119
+ ## Release Verification
120
+
121
+ Before publishing:
122
+
123
+ ```bash
124
+ npm run build
125
+ npm run verify:p0
126
+ npm pack
127
+ ```