@ajaykumarnpm/talea 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/README.md ADDED
@@ -0,0 +1,174 @@
1
+ # talea
2
+
3
+ **One folder structure for every machine you work on.**
4
+
5
+ You have a laptop, a desktop, and a work machine. On each one, the repo you want
6
+ is either missing or somewhere you have to go and find. `talea` fixes that: one
7
+ catalogue of your GitHub repos, one tree, and a command that makes any machine
8
+ match it.
9
+
10
+ ```
11
+ ~/Workspace/
12
+ ProjectAJ14/
13
+ eklavya/
14
+ Morph/
15
+ d-pilot/
16
+ nonstopio/
17
+ flutter_forge/
18
+ json-viewer/
19
+ ```
20
+
21
+ Same paths on every machine. `cd $(talea where eklavya)` works everywhere.
22
+
23
+ ---
24
+
25
+ ## Install
26
+
27
+ ```sh
28
+ npm install -g @ajaykumarnpm/talea
29
+ ```
30
+
31
+ The package is scoped; the command it installs is just `talea`.
32
+
33
+ Node 20 or newer. No other dependencies — not at runtime, not to build it.
34
+
35
+ ## Your first machine
36
+
37
+ ```sh
38
+ talea doctor # git, SSH and GitHub auth all reachable?
39
+ talea init ~/Workspace # discovers your repos, asks what to keep, clones
40
+ talea manifest push # publish the catalogue so the next machine can read it
41
+ ```
42
+
43
+ `init` builds the catalogue from your GitHub account the first time — your own
44
+ repos, every org you belong to, and anything shared with you directly. It then
45
+ asks what this machine should keep and fills the tree.
46
+
47
+ ## Every machine after that
48
+
49
+ ```sh
50
+ talea manifest pull <gist-id> # the id `manifest push` printed
51
+ talea init ~/Workspace
52
+ ```
53
+
54
+ You are handed the full list with your defaults already ticked. Tick the extras
55
+ this machine needs, untick what it does not, press enter.
56
+
57
+ ## Every day
58
+
59
+ ```sh
60
+ talea sync # clone the new, fast-forward the rest
61
+ talea status # branch, clean/dirty, ahead/behind, in one table
62
+ talea add some-repo # keep one more on this machine, and clone it now
63
+ cd $(talea where eklavya)
64
+ ```
65
+
66
+ ---
67
+
68
+ ## The repos you already have
69
+
70
+ This is the part that matters on a machine you have been using for years.
71
+
72
+ `talea` never clones a repo you already have. Before cloning anything it scans
73
+ the workspace — and any folder you name with `--from` — and matches every
74
+ checkout it finds **by its git remote**, not by folder name. A repo cloned into
75
+ `~/tmp/clone2/whatever` is recognised as the repo it holds and **moved** into
76
+ place.
77
+
78
+ A move keeps everything: branches, stashes, the reflog, your uncommitted
79
+ changes. A re-clone throws all of it away, which is why this tool does not do
80
+ one.
81
+
82
+ ```sh
83
+ talea adopt # show what would move, change nothing
84
+ talea adopt --from ~/Desktop # look there too; the folder is remembered
85
+ talea adopt --apply # do it
86
+ ```
87
+
88
+ If the same repo turns up twice, the copy at the catalogue path wins and the
89
+ other moves into `.talea-duplicates/` with everything in it. **Nothing is ever
90
+ deleted.** Clearing that folder is your call.
91
+
92
+ After a move, the absolute paths that pointed at the old location are repaired —
93
+ Claude Code session history and project settings, `.idea`, `.vscode` — because a
94
+ repo that moves and loses its history has not really been helped.
95
+
96
+ ---
97
+
98
+ ## What travels, and what does not
99
+
100
+ | | Where it lives | Shared |
101
+ |---|---|---|
102
+ | **The catalogue** — every repo, its owner, its folder, its default branch | `~/.talea/talea.repos.json` | yes, through a private gist |
103
+ | **What this machine keeps** | `<workspace>/.talea.json` | **never** |
104
+
105
+ That split is the whole design. Pulling the catalogue onto a new laptop gives
106
+ you the full list to *choose* from — not the last machine's choices. Your work
107
+ laptop can keep three repos while the desktop keeps forty, and neither fights
108
+ the other.
109
+
110
+ The gist is private, but it still holds the names of your private repositories.
111
+ Treat the id like a bookmark you would not paste into a public channel.
112
+
113
+ ---
114
+
115
+ ## Commands
116
+
117
+ | | |
118
+ |---|---|
119
+ | `talea init [dir]` | create the workspace on this machine and fill it |
120
+ | `talea discover` | build or refresh the catalogue from GitHub |
121
+ | `talea sync` | clone what is missing, fast-forward what is there |
122
+ | `talea clone` | clone only — never fetches or merges |
123
+ | `talea adopt` | move checkouts you already have into place |
124
+ | `talea status` | branch, clean/dirty, ahead/behind |
125
+ | `talea add` / `talea rm` | change what this machine keeps |
126
+ | `talea where <repo>` | print a repo's path, for `cd $( )` |
127
+ | `talea list` | the catalogue |
128
+ | `talea tree` | the folder tree on disk |
129
+ | `talea exec -- <cmd>` | run one command in every repo |
130
+ | `talea manifest push/pull` | move the catalogue between machines |
131
+ | `talea doctor` | check this machine can do the work |
132
+ | `talea upgrade` | update the CLI itself |
133
+
134
+ Every one of them takes `-g <group>` and `-r <repo>` to narrow the run, and
135
+ `--help` for its own examples.
136
+
137
+ ---
138
+
139
+ ## What it will not do
140
+
141
+ - **It will not push.** Read and checkout only.
142
+ - **It will not throw away uncommitted work.** A dirty repo is fetched and left
143
+ alone, with a line saying so.
144
+ - **It will not merge a divergence.** Fast-forwards only; anything else is
145
+ reported for you to deal with.
146
+ - **It will not move you off your branch.** If you are on a feature branch, that
147
+ is where the work is. It fast-forwards the branch you are on, or leaves it.
148
+ - **It will not delete anything.** Not a duplicate, not a checkout you removed
149
+ from the list, not a folder in the way. It moves things and tells you where.
150
+
151
+ ## Auth
152
+
153
+ Cloning uses **SSH** (`--protocol https` if you prefer). Reading the catalogue
154
+ uses the GitHub API, via the `gh` CLI if it is installed, else `GITHUB_TOKEN`,
155
+ else public repos only — which is a working state, not an error.
156
+
157
+ If `gh` is installed, talea uses it for API calls. That is deliberate beyond the
158
+ token: `gh` trusts your system's certificate store, so talea keeps working on a
159
+ machine behind a corporate proxy or VPN where Node's own HTTPS would fail.
160
+
161
+ ## Contributing
162
+
163
+ ```sh
164
+ git clone git@github.com:ProjectAJ14/talea.git
165
+ cd talea
166
+ npm test # no install step — there are no dependencies
167
+ node bin/talea.js --help
168
+ ```
169
+
170
+ Tests run on macOS, Linux and Windows across Node 20, 22 and 24 on every push.
171
+
172
+ ## Licence
173
+
174
+ MIT.
package/bin/talea.js ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import { main } from '../src/cli.js';
3
+
4
+ main(process.argv.slice(2)).catch((err) => {
5
+ // Anything that reaches here is a bug or an unhandled edge. Print the message
6
+ // a human can act on; keep the stack behind a flag so the normal failure is
7
+ // one readable line rather than a wall of frames.
8
+ console.error(`\n ${err.message}\n`);
9
+ if (process.env.TALEA_DEBUG) console.error(err.stack);
10
+ process.exit(1);
11
+ });
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": 1,
3
+ "workspace": "Workspace",
4
+ "host": "github.com",
5
+ "remotes": {
6
+ "ssh": "git@github.com:{owner}/{repo}.git",
7
+ "https": "https://github.com/{owner}/{repo}.git"
8
+ },
9
+ "groups": {},
10
+ "repos": []
11
+ }
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@ajaykumarnpm/talea",
3
+ "version": "0.1.0",
4
+ "description": "One folder structure for every machine. Clone, adopt and sync your GitHub repos from a manifest you own.",
5
+ "type": "module",
6
+ "bin": {
7
+ "talea": "bin/talea.js"
8
+ },
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "engines": {
13
+ "node": ">=20.0.0"
14
+ },
15
+ "files": [
16
+ "bin",
17
+ "src",
18
+ "manifest",
19
+ "templates",
20
+ "README.md"
21
+ ],
22
+ "scripts": {
23
+ "test": "node --test"
24
+ },
25
+ "keywords": [
26
+ "github",
27
+ "workspace",
28
+ "repos",
29
+ "clone",
30
+ "sync",
31
+ "cli",
32
+ "dotfiles"
33
+ ],
34
+ "license": "MIT",
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/ProjectAJ14/talea.git"
38
+ }
39
+ }