@openlor/dotai 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.
- package/LICENSE +21 -0
- package/README.md +127 -0
- package/dist/cli.js +3332 -0
- package/dist/profiles/claude.json +8 -0
- package/dist/profiles/codex.json +8 -0
- package/dist/profiles/profiles/claude.json +8 -0
- package/dist/profiles/profiles/codex.json +8 -0
- package/package.json +30 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 gobylor
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# dotai
|
|
2
|
+
|
|
3
|
+
AI CLI config manager — sync Claude Code, Codex, and more between machines.
|
|
4
|
+
|
|
5
|
+
## What is this?
|
|
6
|
+
|
|
7
|
+
`dotai` is a dotfiles manager for the AI coding era. It syncs your AI CLI configurations (settings, permissions, skills, commands, plugins) between machines via a JSON manifest backed by Git.
|
|
8
|
+
|
|
9
|
+
**Two dimensions, one tool:**
|
|
10
|
+
- **Horizontal:** manage configs for Claude Code + Codex (+ future CLIs) on one machine
|
|
11
|
+
- **Vertical:** sync all configs between machines
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# In your config repo directory:
|
|
17
|
+
npx dotai init # Auto-discover CLIs, generate manifest
|
|
18
|
+
npx dotai export # Copy configs from machine to repo
|
|
19
|
+
git add -A && git commit -m "my ai config"
|
|
20
|
+
git push
|
|
21
|
+
|
|
22
|
+
# On another machine:
|
|
23
|
+
npx dotai use <your-github-user>/dotai-config
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Commands
|
|
27
|
+
|
|
28
|
+
| Command | Description |
|
|
29
|
+
|---------|-------------|
|
|
30
|
+
| `dotai init` | Auto-discover AI CLIs, generate `dotai.json` manifest + `.gitignore` |
|
|
31
|
+
| `dotai export` | Copy configs from machine to repo, auto-generate README |
|
|
32
|
+
| `dotai import` | Copy configs from repo to machine (with backup) |
|
|
33
|
+
| `dotai diff` | Show differences between repo and machine |
|
|
34
|
+
| `dotai status` | Sync summary dashboard |
|
|
35
|
+
| `dotai use <user/repo>` | Import config from a GitHub repo |
|
|
36
|
+
| `dotai doctor` | Health check: validate manifest, scan for credentials, flag stale paths |
|
|
37
|
+
|
|
38
|
+
### Common Flags
|
|
39
|
+
|
|
40
|
+
| Flag | Available on | Description |
|
|
41
|
+
|------|-------------|-------------|
|
|
42
|
+
| `--only <tool>` | export, import, diff, status | Operate on a single tool only |
|
|
43
|
+
| `--dry-run` | import, use | Preview changes without writing |
|
|
44
|
+
| `--sync` | import | Delete machine files not in repo (with backup) |
|
|
45
|
+
| `--verbose` | export, import, use | Show per-file operations |
|
|
46
|
+
|
|
47
|
+
## How It Works
|
|
48
|
+
|
|
49
|
+
### 1. Manifest (`dotai.json`)
|
|
50
|
+
|
|
51
|
+
A JSON file declares which files from each CLI's config directory should be synced:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"version": 1,
|
|
56
|
+
"tools": {
|
|
57
|
+
"claude": {
|
|
58
|
+
"source": "~/.claude",
|
|
59
|
+
"include": ["settings.json", "commands/", "skills/"],
|
|
60
|
+
"exclude": ["sessions/", "cache/", "history.jsonl"]
|
|
61
|
+
},
|
|
62
|
+
"codex": {
|
|
63
|
+
"source": "~/.codex",
|
|
64
|
+
"include": ["config.toml", "rules/", "skills/"],
|
|
65
|
+
"exclude": ["history.jsonl", "sessions/", "auth.json"]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 2. Tool Profiles
|
|
72
|
+
|
|
73
|
+
Built-in profiles for Claude Code and Codex know which files are portable (settings, commands, skills) and which are ephemeral (sessions, cache, history). `dotai init` uses these profiles to auto-generate the manifest.
|
|
74
|
+
|
|
75
|
+
Adding support for a new AI CLI is as simple as adding a JSON profile file.
|
|
76
|
+
|
|
77
|
+
### 3. File State Model
|
|
78
|
+
|
|
79
|
+
Every managed file is in one of four states:
|
|
80
|
+
|
|
81
|
+
| State | Meaning |
|
|
82
|
+
|-------|---------|
|
|
83
|
+
| `in-sync` | Identical in repo and on machine |
|
|
84
|
+
| `modified` | Exists in both but content differs |
|
|
85
|
+
| `repo-only` | In repo but not on machine |
|
|
86
|
+
| `machine-only` | On machine but not in repo |
|
|
87
|
+
|
|
88
|
+
### 4. Security
|
|
89
|
+
|
|
90
|
+
- **No transformation** — files are copied exactly as-is
|
|
91
|
+
- `dotai doctor` scans for credential files accidentally in repo
|
|
92
|
+
- `dotai use` restricts source paths to known AI CLI config directories
|
|
93
|
+
- Auto-generated `.gitignore` excludes credentials and ephemeral data
|
|
94
|
+
|
|
95
|
+
## Design Principles
|
|
96
|
+
|
|
97
|
+
- **No transformation** — JSON stays JSON, TOML stays TOML. No path rewriting.
|
|
98
|
+
- **Additive by default** — `import` only copies, never deletes (unless `--sync`)
|
|
99
|
+
- **Backup before overwrite** — every import creates a timestamped backup per tool
|
|
100
|
+
- **Two-repo model** — this repo is the tool; your configs live in a separate repo
|
|
101
|
+
|
|
102
|
+
## Supported CLIs
|
|
103
|
+
|
|
104
|
+
| CLI | Config Dir | Status |
|
|
105
|
+
|-----|-----------|--------|
|
|
106
|
+
| Claude Code | `~/.claude` | Built-in |
|
|
107
|
+
| Codex | `~/.codex` | Built-in |
|
|
108
|
+
| Cursor | `~/.cursor` | Add profile |
|
|
109
|
+
| Windsurf | `~/.windsurf` | Add profile |
|
|
110
|
+
| Aider | `~/.aider` | Add profile |
|
|
111
|
+
|
|
112
|
+
## Installation
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# Use without installing (recommended)
|
|
116
|
+
npx dotai <command>
|
|
117
|
+
|
|
118
|
+
# Or install globally
|
|
119
|
+
npm install -g dotai
|
|
120
|
+
bun install -g dotai
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Requires Node.js >= 18 or Bun.
|
|
124
|
+
|
|
125
|
+
## License
|
|
126
|
+
|
|
127
|
+
MIT
|