@willh/copilotstatusline 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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Matthew Breedlove (https://github.com/sirmalloc)
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/NOTICE ADDED
@@ -0,0 +1,8 @@
1
+ copilotstatusline
2
+
3
+ Copyright (c) 2025 Matthew Breedlove (https://github.com/sirmalloc)
4
+
5
+ This project is licensed under the MIT License.
6
+ See the LICENSE file for details.
7
+
8
+ Official repository: https://github.com/sirmalloc/copilotstatusline
package/README.md ADDED
@@ -0,0 +1,109 @@
1
+ # copilotstatusline
2
+
3
+ A customizable command status line for GitHub Copilot CLI.
4
+
5
+ `copilotstatusline` reads the JSON payload that Copilot CLI sends to a custom status-line command and renders one or more terminal lines. Running it in an interactive terminal opens an Ink configuration UI.
6
+
7
+ ## Requirements
8
+
9
+ - GitHub Copilot CLI 1.0.52 or newer for shell-command status lines
10
+ - Node.js 22 or newer when running the published bundle
11
+ - Bun for development
12
+
13
+ The implementation targets the user-level Copilot settings file at `$COPILOT_HOME/settings.json`, falling back to `~/.copilot/settings.json`. Repository-level `.github/copilot/settings.json` files do not support the `statusLine` setting.
14
+
15
+ ## Quick start
16
+
17
+ Launch the configuration UI:
18
+
19
+ ```sh
20
+ npx -y copilotstatusline@latest
21
+ ```
22
+
23
+ Choose `Install or repair Copilot integration`, or install non-interactively:
24
+
25
+ ```sh
26
+ npx -y copilotstatusline@latest --install npm
27
+ ```
28
+
29
+ The installer merges the following keys into the existing Copilot settings and preserves unrelated settings:
30
+
31
+ ```json
32
+ {
33
+ "statusLine": {
34
+ "type": "command",
35
+ "command": "npx -y copilotstatusline@latest",
36
+ "padding": 0
37
+ },
38
+ "footer": {
39
+ "showCustom": true
40
+ }
41
+ }
42
+ ```
43
+
44
+ Restart Copilot CLI after changing its settings.
45
+
46
+ ## Command line
47
+
48
+ ```text
49
+ copilotstatusline Open the configuration UI
50
+ copilotstatusline --install npm Install an npx command
51
+ copilotstatusline --install bunx Install a bunx command
52
+ copilotstatusline --install global Install a global binary command
53
+ copilotstatusline --uninstall Remove an owned integration
54
+ copilotstatusline --check Print integration status as JSON
55
+ copilotstatusline --config <path> Use a custom formatter settings file
56
+ copilotstatusline --version Print the package version
57
+ ```
58
+
59
+ When `--config` is combined with `--install`, the absolute config path is included in Copilot's command setting.
60
+
61
+ ## Widgets
62
+
63
+ The initial release supports Copilot-native fields for model, reasoning effort, version, session, token totals, cache tokens, last-call tokens, context usage, premium requests, durations, changed-line counts, and allow-all state.
64
+
65
+ Local widgets include current directory, Git branch and change counts, Jujutsu change ID, terminal width, free memory, custom text, custom commands, explicit separators, and flexible spacing. Powerline rendering and multiple status lines are supported.
66
+
67
+ Custom commands run through the local shell with the Copilot working directory and a 500 ms timeout. Treat the formatter settings file as executable configuration.
68
+
69
+ ## Configuration
70
+
71
+ Formatter settings are stored at:
72
+
73
+ - Linux and macOS: `$XDG_CONFIG_HOME/copilotstatusline/settings.json`, or `~/.config/copilotstatusline/settings.json`
74
+ - Windows: `%APPDATA%\copilotstatusline\settings.json`
75
+
76
+ Malformed configuration is never overwritten during status rendering. Defaults are used in memory and a warning is written to stderr. Interactive mode creates a missing settings file; piped mode does not.
77
+
78
+ See [Usage](docs/USAGE.md), [Development](docs/DEVELOPMENT.md), and [Windows](docs/WINDOWS.md) for details.
79
+
80
+ ## Manual payload test
81
+
82
+ ```sh
83
+ bun run example
84
+ ```
85
+
86
+ Or pipe a payload directly:
87
+
88
+ ```sh
89
+ printf '%s\n' '{"model":{"id":"gpt-5","display_name":"GPT-5"},"context_window":{"current_context_tokens":25000,"displayed_context_limit":128000}}' | bun run src/copilotstatusline.ts
90
+ ```
91
+
92
+ ## Development
93
+
94
+ ```sh
95
+ bun install
96
+ bun run lint
97
+ bun test
98
+ bun run build
99
+ ```
100
+
101
+ ## Upstream references
102
+
103
+ - [Copilot CLI configuration directory reference](https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-config-dir-reference)
104
+ - [Copilot CLI command reference](https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference)
105
+ - [Copilot CLI changelog](https://github.com/github/copilot-cli/blob/main/changelog.md)
106
+
107
+ ## License
108
+
109
+ MIT. See [LICENSE](LICENSE).