@telepath-computer/stash 0.2.4 → 0.3.2

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/README.md CHANGED
@@ -11,14 +11,11 @@ npm install -g @telepath-computer/stash
11
11
  Set up GitHub access and connect the current directory:
12
12
 
13
13
  ```bash
14
- stash background install
15
- stash init
16
14
  stash setup github
17
- stash connect github --repo user/repo --background
15
+ stash connect github --repo user/repo
16
+ stash start
18
17
  ```
19
18
 
20
- You can initialize a directory explicitly with `stash init`, or let `stash connect` create `.stash/` for you automatically.
21
-
22
19
  You'll need a GitHub personal access token. We recommend a **fine-grained token** scoped to only the repos you use with stash.
23
20
 
24
21
  ### Creating a GitHub Token
@@ -43,28 +40,37 @@ Use this token when running `stash setup github`.
43
40
  ## Commands
44
41
 
45
42
  ```bash
46
- stash background install
47
- stash background add
48
- stash init
49
43
  stash setup github
50
- stash connect github --repo user/repo --background
44
+ stash connect github --repo user/repo
45
+ stash start
46
+ stash stop
51
47
  stash sync
52
48
  stash watch
53
- stash background status
54
49
  stash status
50
+ stash status --all
51
+ stash disconnect
55
52
  stash disconnect github
56
- stash background remove
57
- stash background uninstall
58
53
  ```
59
54
 
60
55
  `stash watch` keeps the directory in sync continuously. Press `.` to trigger an immediate sync and `q` to quit.
61
56
 
62
- `stash background install` plus `stash connect --background` gives you boot-time background syncing managed by `launchd` on macOS or `systemd` on Linux.
57
+ `stash start` enables boot-time background syncing managed by `launchd` on macOS or `systemd` on Linux. Connected stashes are registered automatically.
58
+
59
+ `stash disconnect` removes the current stash completely. `stash disconnect <provider>` removes one provider connection and removes `.stash/` too if that was the last one.
60
+
61
+ Typical `stash start` output:
62
+
63
+ ```text
64
+ Background sync is on
65
+ Watching 1 stash · starts on startup
66
+ ```
63
67
 
64
68
  ## Config
65
69
 
66
70
  - Global config lives at `~/.stash/config.json` or `$XDG_CONFIG_HOME/stash/config.json`.
67
- - Per-stash connection config lives at `.stash/config.local.json` inside the synced directory.
71
+ - Per-stash config lives at `.stash/config.json` inside the synced directory.
72
+
73
+ Older prerelease stashes using `.stash/config.local.json` and `.stash/snapshot.local/` are migrated automatically on startup.
68
74
 
69
75
  Example global config:
70
76
 
@@ -83,6 +89,7 @@ Example global config:
83
89
 
84
90
  - `docs/api.md` - developer-facing `Stash` and provider contracts
85
91
  - `docs/architecture.md` - core components and repo boundaries
92
+ - `docs/config.md` - config locations, metadata files, and config key conventions
86
93
  - `docs/sync.md` - sync lifecycle, locking, drift, and snapshot semantics
87
94
  - `docs/reconciliation.md` - merge and file-resolution rules
88
95
  - `docs/cli.md` - user-facing CLI behavior
@@ -99,6 +106,12 @@ Not blindly. On first sync, local and remote content are reconciled rather than
99
106
 
100
107
  Yes, but not on the same machine and directory. Stash syncs the working tree directly to `main` through the GitHub API and does not understand local git state.
101
108
 
109
+ ## Using Stash With Git
110
+
111
+ By default, stash refuses to sync a directory that contains `.git/`. Branch switches look like mass file edits to stash, so syncing inside a git working tree can push destructive changes to the remote.
112
+
113
+ If you do not need git in that directory, remove `.git/`. If you intentionally want both, run `stash config set allow-git true` first, then keep stash pinned to one branch and do not switch branches while stash is active.
114
+
102
115
  **Does stash use branches or PRs?**
103
116
 
104
117
  No. Stash reads and writes the `main` branch directly.
@@ -7,6 +7,10 @@ type ServiceHandle = {
7
7
  running: boolean;
8
8
  }>;
9
9
  };
10
+ type ServiceLaunch = {
11
+ command: string;
12
+ args: string[];
13
+ };
10
14
  type CliDependencies = {
11
15
  cwd?: () => string;
12
16
  readGlobalConfig?: () => Promise<GlobalConfig>;
@@ -16,7 +20,7 @@ type CliDependencies = {
16
20
  stdout?: NodeJS.WriteStream;
17
21
  stderr?: NodeJS.WriteStream;
18
22
  };
19
- export declare function resolveStashCommand(): Promise<string>;
23
+ export declare function resolveServiceLaunch(argv?: string[]): Promise<ServiceLaunch>;
20
24
  export declare function main(argv?: string[], deps?: CliDependencies): Promise<void>;
21
25
  export {};
22
26
  //# sourceMappingURL=cli-main.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli-main.d.ts","sourceRoot":"","sources":["../src/cli-main.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAS,YAAY,EAAiB,MAAM,YAAY,CAAC;AAKrE,KAAK,aAAa,GAAG;IACnB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,MAAM,IAAI,OAAO,CAAC;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CAC7D,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/C,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC;CAC7B,CAAC;AAkCF,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,MAAM,CAAC,CAoB3D;AAoXD,wBAAsB,IAAI,CAAC,IAAI,WAAe,EAAE,IAAI,GAAE,eAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CA+IzF"}
1
+ {"version":3,"file":"cli-main.d.ts","sourceRoot":"","sources":["../src/cli-main.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAS,YAAY,EAAiB,MAAM,YAAY,CAAC;AAKrE,KAAK,aAAa,GAAG;IACnB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;I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