You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-18Lines changed: 31 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,14 @@
1
1
# tome-cli
2
2
3
-
4
3
A rewrite of [`sub`](https://github.com/qrush/sub) and [`tome`](https://github.com/toumorokoshi/tome) and my fork of [tome](https://github.com/zph/tome) but with a different internal implementation in order to support:
5
4
1. Improved auto-completion
6
5
2. Improved usage/help outputs
7
6
3. Faster development
8
7
4. Testable interfaces
9
8
10
-
# Interface
9
+
# Usage
11
10
12
11
```
13
-
export TOME_ROOT=examples
14
-
tome-cli exec path to file
15
-
tome-cli help path to <TAB>
16
-
tome-cli completion fish | source
17
-
tome-cli alias --write kit
18
-
19
12
# shorthand syntax via bash wrapper script
20
13
tome-cli --executable kit alias --output ~/bin/kit
21
14
@@ -24,11 +17,37 @@ kit completion fish | source
24
17
kit path to file
25
18
kit pat<TAB>
26
19
20
+
# Long form
21
+
export TOME_ROOT=examples
22
+
tome-cli exec path to file
23
+
tome-cli help path to <TAB>
24
+
tome-cli completion fish | source
25
+
26
+
# Setup tab completion
27
+
tome-cli completion fish | source
28
+
eval "$(tome-cli completion zsh)"
27
29
28
-
# Print out completions for zsh | fish | bash
29
-
tome completion zsh
30
+
# See instructions for a command
31
+
tome-cli completion --help
30
32
```
31
33
34
+
See [docs](./docs/tome-cli.md) for expanded instructions
35
+
36
+
# Features
37
+
38
+
- Organize a folder of scripts into a CLI sdk
39
+
- Any language is supported via normal script `#!`
40
+
- Usage text extracted from script header if `USAGE: ` is included in leading comments
41
+
- Full help text extracted as lines from `USAGE: ` to first empty line
42
+
- Builtin alias generator allows for embedding configuration flags via tome-cli [alias](./docs/tome-cli_alias.md)
43
+
- Auto completion of:
44
+
- subcommands (exec, help, etc)
45
+
- root folder's folder names
46
+
- root folder's scripts
47
+
- root script's flags and arguments (when they satisfy the --complete and TOME_COMPLETION interface)
48
+
- Gitignore like syntax for ignoring scripts by using a `.tome_ignore` file at base of root folder
49
+
-
50
+
32
51
# Capabilities
33
52
34
53
-[x] exec scripts in a directory
@@ -51,8 +70,8 @@ tome completion zsh
51
70
-[x] auto-complete script arguments (scripts that include the text TOME_COMPLETION which are tab completed will try to get autocompletes from the script via executing it with --completion)
52
71
-[x] injects TOME_ROOT into tooling as env var and TOME_EXECUTABLE
53
72
-[x] Add level and k/v style logging
54
-
-[] Add instructions to README
55
-
-[] Generate a docs folder for more full instructions (https://umarcor.github.io/cobra/#generating-markdown-docs-for-your-own-cobracommand)
73
+
-[x] Add instructions to README
74
+
-[x] Generate a docs folder for more full instructions (https://umarcor.github.io/cobra/#generating-markdown-docs-for-your-own-cobracommand)
56
75
-[ ] See if there's utility in ActiveHelp https://umarcor.github.io/cobra/#active-help
57
76
-[ ] pre-hooks (hooks.d folder will be sourced in order or executed before the real script)
0 commit comments