microgit-cli 0.1.5 → 0.1.6
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 +11 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# microgit-cli
|
|
2
2
|
|
|
3
|
-
`microgit`
|
|
3
|
+
`microgit` - **your own git server - clone, push, host**.
|
|
4
4
|
|
|
5
5
|
A small command line client for the [microgit-server](https://www.npmjs.com/package/microgit-server) server. It keeps the API
|
|
6
6
|
session in a local config file, creates and deletes repositories, and wraps the
|
|
@@ -13,16 +13,6 @@ usual `git` commands so push/pull work with the account credentials.
|
|
|
13
13
|
npm install -g microgit-cli
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Without a global install, run the built entry point directly:
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
node src/index.js --help
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
On the first run (when `~/.microgit/config.json` does not exist yet) the CLI asks
|
|
23
|
-
for the server URL and stores it, so you do not have to pass `--url` every time.
|
|
24
|
-
You can change it later with `microgit config set url <url>` or by editing the
|
|
25
|
-
file with `microgit config edit`.
|
|
26
16
|
|
|
27
17
|
## Interactive shell
|
|
28
18
|
|
|
@@ -63,20 +53,22 @@ Errors never close the shell. A command that asks something (`login`,
|
|
|
63
53
|
## Quick start
|
|
64
54
|
|
|
65
55
|
```bash
|
|
66
|
-
# 1.
|
|
67
|
-
|
|
68
|
-
|
|
56
|
+
# 1. Register an account (non-interactive example).
|
|
57
|
+
microgit register --url http://127.0.0.1:80 --user abc --password 1234
|
|
58
|
+
|
|
59
|
+
# 2. Sign in (non-interactive example).
|
|
60
|
+
microgit login --url http://127.0.0.1:80 --user abc --password 1234
|
|
69
61
|
|
|
70
|
-
#
|
|
62
|
+
# 3. Create a repository and a local checkout with a first commit,
|
|
71
63
|
# then push it.
|
|
72
64
|
microgit new app --init
|
|
73
65
|
|
|
74
|
-
#
|
|
66
|
+
# 4. Work as usual; commit also pushes.
|
|
75
67
|
cd app
|
|
76
68
|
echo "hello" > hello.txt
|
|
77
69
|
microgit commit -m "Add hello.txt"
|
|
78
70
|
|
|
79
|
-
#
|
|
71
|
+
# 5. Check the session or list repositories.
|
|
80
72
|
microgit whoami
|
|
81
73
|
microgit list
|
|
82
74
|
```
|
|
@@ -101,7 +93,7 @@ only asked for once. Add `--force` to sign in as another account.
|
|
|
101
93
|
| `microgit commit -m "message"` | `git add -A`, commit, then push |
|
|
102
94
|
| `microgit push [git args]` | Push with stored credentials |
|
|
103
95
|
| `microgit pull [git args]` | Pull with stored credentials |
|
|
104
|
-
| `microgit config` | Show the config file
|
|
96
|
+
| `microgit config` | Show or edit the config file and session |
|
|
105
97
|
|
|
106
98
|
Every command accepts `-h` / `--help`. Commands that print API data also accept
|
|
107
99
|
`--json` where it makes sense (`whoami`, `list`, `new`, `delete`, `clone`,
|
|
@@ -207,6 +199,7 @@ microgit config set url https://git.example.com
|
|
|
207
199
|
microgit config set username alice
|
|
208
200
|
microgit config unset password
|
|
209
201
|
microgit config clear
|
|
202
|
+
microgit config edit # open config.json in $EDITOR / notepad
|
|
210
203
|
```
|
|
211
204
|
|
|
212
205
|
Environment variables override the file for one command:
|