console-cowboy 0.3.0__tar.gz

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.
Files changed (42) hide show
  1. console_cowboy-0.3.0/LICENSE +201 -0
  2. console_cowboy-0.3.0/PKG-INFO +437 -0
  3. console_cowboy-0.3.0/README.md +408 -0
  4. console_cowboy-0.3.0/console_cowboy/__init__.py +0 -0
  5. console_cowboy-0.3.0/console_cowboy/__main__.py +4 -0
  6. console_cowboy-0.3.0/console_cowboy/cli.py +957 -0
  7. console_cowboy-0.3.0/console_cowboy/ctec/__init__.py +52 -0
  8. console_cowboy-0.3.0/console_cowboy/ctec/schema.py +1616 -0
  9. console_cowboy-0.3.0/console_cowboy/ctec/serializers.py +596 -0
  10. console_cowboy-0.3.0/console_cowboy/terminals/__init__.py +36 -0
  11. console_cowboy-0.3.0/console_cowboy/terminals/alacritty.py +896 -0
  12. console_cowboy-0.3.0/console_cowboy/terminals/base.py +294 -0
  13. console_cowboy-0.3.0/console_cowboy/terminals/ghostty.py +886 -0
  14. console_cowboy-0.3.0/console_cowboy/terminals/iterm2.py +1020 -0
  15. console_cowboy-0.3.0/console_cowboy/terminals/kitty.py +797 -0
  16. console_cowboy-0.3.0/console_cowboy/terminals/terminal_app.py +553 -0
  17. console_cowboy-0.3.0/console_cowboy/terminals/vscode.py +384 -0
  18. console_cowboy-0.3.0/console_cowboy/terminals/wezterm/__init__.py +5 -0
  19. console_cowboy-0.3.0/console_cowboy/terminals/wezterm/adapter.py +1264 -0
  20. console_cowboy-0.3.0/console_cowboy/terminals/wezterm/lua.py +475 -0
  21. console_cowboy-0.3.0/console_cowboy/utils/__init__.py +7 -0
  22. console_cowboy-0.3.0/console_cowboy/utils/colors.py +91 -0
  23. console_cowboy-0.3.0/console_cowboy/utils/font_registry.py +430 -0
  24. console_cowboy-0.3.0/console_cowboy/utils/fonts.py +249 -0
  25. console_cowboy-0.3.0/console_cowboy/utils/nsarchive.py +397 -0
  26. console_cowboy-0.3.0/console_cowboy/validation.py +192 -0
  27. console_cowboy-0.3.0/console_cowboy.egg-info/PKG-INFO +437 -0
  28. console_cowboy-0.3.0/console_cowboy.egg-info/SOURCES.txt +40 -0
  29. console_cowboy-0.3.0/console_cowboy.egg-info/dependency_links.txt +1 -0
  30. console_cowboy-0.3.0/console_cowboy.egg-info/entry_points.txt +2 -0
  31. console_cowboy-0.3.0/console_cowboy.egg-info/requires.txt +5 -0
  32. console_cowboy-0.3.0/console_cowboy.egg-info/top_level.txt +1 -0
  33. console_cowboy-0.3.0/pyproject.toml +121 -0
  34. console_cowboy-0.3.0/setup.cfg +4 -0
  35. console_cowboy-0.3.0/tests/test_console_cowboy.py +641 -0
  36. console_cowboy-0.3.0/tests/test_ctec_schema.py +671 -0
  37. console_cowboy-0.3.0/tests/test_font_fixes.py +304 -0
  38. console_cowboy-0.3.0/tests/test_font_registry.py +147 -0
  39. console_cowboy-0.3.0/tests/test_fonts.py +195 -0
  40. console_cowboy-0.3.0/tests/test_serializers.py +304 -0
  41. console_cowboy-0.3.0/tests/test_terminals.py +2367 -0
  42. console_cowboy-0.3.0/tests/test_validation.py +153 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,437 @@
1
+ Metadata-Version: 2.4
2
+ Name: console-cowboy
3
+ Version: 0.3.0
4
+ Summary: Hop terminals like you hop linux distributions.
5
+ Author: zetlen
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/zetlen/console-cowboy
8
+ Project-URL: Changelog, https://github.com/zetlen/console-cowboy/blob/main/CHANGELOG.md
9
+ Project-URL: Issues, https://github.com/zetlen/console-cowboy/issues
10
+ Project-URL: CI, https://github.com/zetlen/console-cowboy/actions
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Utilities
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: click
24
+ Requires-Dist: lupa>=2.0
25
+ Requires-Dist: pyyaml>=6.0
26
+ Requires-Dist: tomli>=2.0
27
+ Requires-Dist: tomli-w>=1.0
28
+ Dynamic: license-file
29
+
30
+ # console-cowboy
31
+
32
+ [![PyPI](https://img.shields.io/pypi/v/console-cowboy.svg)](https://pypi.org/project/console-cowboy/)
33
+ [![Changelog](https://img.shields.io/github/v/release/zetlen/console-cowboy?include_prereleases&label=changelog)](https://github.com/zetlen/console-cowboy/releases)
34
+ [![Tests](https://github.com/zetlen/console-cowboy/actions/workflows/test.yml/badge.svg)](https://github.com/zetlen/console-cowboy/actions/workflows/test.yml)
35
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/zetlen/console-cowboy/blob/master/LICENSE)
36
+
37
+ **Hop terminals like you hop Linux distributions.**
38
+
39
+ Console Cowboy is a CLI tool for making terminal configurations portable across different terminal emulators. Export your settings from one terminal and import them into another.
40
+
41
+ ## Features
42
+
43
+ - **Portable Configuration Format**: Uses CTEC (Common Terminal Emulator Configuration) as an intermediate representation
44
+ - **Multiple Terminal Support**: Import and export configurations for:
45
+ - iTerm2
46
+ - Ghostty
47
+ - Alacritty
48
+ - Kitty
49
+ - Wezterm
50
+ - Terminal.app (macOS)
51
+ - VS Code (integrated terminal)
52
+ - **Automatic Format Detection**: Detects terminal config formats automatically from file contents
53
+ - **Smart Path Resolution**: Use terminal names to read/write to default config locations
54
+ - **iTerm2-Color-Schemes Compatible**: Color schemes use the same YAML format as the popular [iTerm2-Color-Schemes](https://github.com/mbadolato/iTerm2-Color-Schemes) project
55
+ - **Quick Terminal Support**: Migrate quake-style dropdown terminal settings between iTerm2, Ghostty, and Kitty
56
+ - **Stdin/Stdout Support**: Pipe configs through shell pipelines
57
+ - **Incompatibility Reporting**: Clearly reports which settings cannot be converted between terminals
58
+ - **Terminal-Specific Settings**: Preserves terminal-specific settings that don't have equivalents in other terminals
59
+
60
+ ## Installation
61
+
62
+ Install using `uv` (recommended):
63
+
64
+ ```bash
65
+ uv tool install console-cowboy
66
+ ```
67
+
68
+ Or with `pip`:
69
+
70
+ ```bash
71
+ pip install console-cowboy
72
+ ```
73
+
74
+ Or with `pipx` for isolated installation:
75
+
76
+ ```bash
77
+ pipx install console-cowboy
78
+ ```
79
+
80
+ ## Quick Start
81
+
82
+ ### Convert between terminals
83
+
84
+ ```bash
85
+ # Convert iTerm2 settings directly to Ghostty config
86
+ console-cowboy --from iterm2 --to ghostty
87
+
88
+ # Convert from a specific file to a terminal's default location
89
+ console-cowboy --from ~/path/to/config --to ghostty
90
+
91
+ # Convert between specific files
92
+ console-cowboy --from config.lua --from-type wezterm --to config.toml --to-type alacritty
93
+ ```
94
+
95
+ ### Export to portable CTEC format
96
+
97
+ ```bash
98
+ # Export iTerm2 config to CTEC (outputs to stdout)
99
+ console-cowboy --from iterm2
100
+
101
+ # Export to a file
102
+ console-cowboy export --from kitty --to my-config.yaml
103
+
104
+ # Export a specific iTerm2 profile
105
+ console-cowboy export --from iterm2 --profile "Development"
106
+ ```
107
+
108
+ ### Import from CTEC format
109
+
110
+ ```bash
111
+ # Import CTEC to a terminal's default location
112
+ console-cowboy import --from my-config.yaml --to ghostty
113
+
114
+ # Import to a specific file
115
+ console-cowboy import --from my-config.yaml --to ~/.config/alacritty/alacritty.toml --to-type alacritty
116
+
117
+ # Preview import without saving (output to stdout)
118
+ console-cowboy import --from my-config.yaml --to-type wezterm
119
+ ```
120
+
121
+ ### Use with pipes
122
+
123
+ ```bash
124
+ # Pipe between commands
125
+ console-cowboy --from iterm2 | console-cowboy import --from - --to ghostty
126
+
127
+ # Read from stdin
128
+ cat my-config.yaml | console-cowboy --from - --from-type ctec --to-type kitty
129
+ ```
130
+
131
+ ## CLI Reference
132
+
133
+ Console Cowboy uses `--from` and `--to` flags for all operations. The implicit command is conversion; explicit `export`, `import`, and `convert` commands are also available.
134
+
135
+ ### Default Command (Convert)
136
+
137
+ ```bash
138
+ console-cowboy [--from SOURCE] [--from-type TYPE] [--to DEST] [--to-type TYPE] [--profile NAME] [--quiet]
139
+ ```
140
+
141
+ The `--from` and `--to` arguments accept:
142
+ - **Terminal name**: `iterm2`, `ghostty`, `alacritty`, `kitty`, `wezterm`, `vscode`, `terminal_app` - reads from/writes to the terminal's default config location
143
+ - **File path**: Path to a config file
144
+ - **`-`**: Read from stdin / write to stdout
145
+
146
+ Type detection:
147
+ - If a terminal name is given, that format is used
148
+ - If a file path is given, the format is auto-detected from content
149
+ - Use `--from-type` or `--to-type` to override: `ctec` or a terminal name
150
+
151
+ Behavior:
152
+ - `--from` without `--to`: Outputs CTEC to stdout
153
+ - `--from` with `--to`: Converts and writes to destination
154
+ - `--to-type` without `--to`: Outputs that format to stdout
155
+
156
+ Options:
157
+ - `--from`: Source (terminal name, file path, or `-` for stdin)
158
+ - `--from-type`: Explicit source type (`ctec` or terminal name)
159
+ - `--to`: Destination (terminal name, file path, or `-` for stdout)
160
+ - `--to-type`: Explicit destination type (`ctec` or terminal name)
161
+ - `--profile`: Profile name (iTerm2/Terminal.app only)
162
+ - `--quiet`: Suppress warnings and informational output
163
+
164
+ ### `export`
165
+
166
+ Export a terminal's configuration to CTEC format (always YAML).
167
+
168
+ ```bash
169
+ console-cowboy export --from SOURCE [--from-type TYPE] [--to OUTPUT] [--profile NAME] [--quiet]
170
+ ```
171
+
172
+ Options:
173
+ - `--from`: Source terminal or config file (required)
174
+ - `--from-type`: Explicit source type (terminal name)
175
+ - `--to`: Output file (defaults to stdout)
176
+ - `--profile`: Profile name (iTerm2/Terminal.app only)
177
+ - `--quiet`: Suppress warnings
178
+
179
+ ### `import`
180
+
181
+ Import a CTEC configuration into a terminal's native format.
182
+
183
+ ```bash
184
+ console-cowboy import --from CTEC_FILE [--to DEST] [--to-type TYPE] [--quiet]
185
+ ```
186
+
187
+ Options:
188
+ - `--from`: CTEC file path or `-` for stdin (required)
189
+ - `--to`: Destination terminal or file
190
+ - `--to-type`: Explicit destination type (terminal name, required if `--to` is a file)
191
+ - `--quiet`: Suppress warnings
192
+
193
+ ### `convert`
194
+
195
+ Convert directly between terminal configuration formats.
196
+
197
+ ```bash
198
+ console-cowboy convert --from SOURCE --to DEST [--from-type TYPE] [--to-type TYPE] [--profile NAME] [--quiet]
199
+ ```
200
+
201
+ Options:
202
+ - `--from`: Source terminal or config file (required)
203
+ - `--to`: Destination terminal or file (required)
204
+ - `--from-type`: Explicit source type
205
+ - `--to-type`: Explicit destination type
206
+ - `--profile`: Profile name (iTerm2/Terminal.app source only)
207
+ - `--quiet`: Suppress warnings
208
+
209
+ ### `list`
210
+
211
+ List all supported terminal emulators.
212
+
213
+ ```bash
214
+ console-cowboy list
215
+ ```
216
+
217
+ ### `info`
218
+
219
+ Display information about a configuration file.
220
+
221
+ ```bash
222
+ console-cowboy info --from SOURCE [--from-type TYPE]
223
+ ```
224
+
225
+ ## Example Workflows
226
+
227
+ ### Migrate from iTerm2 to Ghostty
228
+
229
+ ```bash
230
+ # Direct conversion to Ghostty's default config location
231
+ console-cowboy --from iterm2 --to ghostty
232
+ ```
233
+
234
+ ### Backup your terminal config
235
+
236
+ ```bash
237
+ # Export to a portable format
238
+ console-cowboy export --from ghostty --to ~/backups/terminal-config.yaml
239
+ ```
240
+
241
+ ### Test a config on another terminal
242
+
243
+ ```bash
244
+ # Preview how your config would look in Kitty
245
+ console-cowboy --from ~/.config/alacritty/alacritty.toml --to-type kitty
246
+
247
+ # Or pipe it for processing
248
+ console-cowboy --from wezterm | less
249
+ ```
250
+
251
+ ### Use in scripts
252
+
253
+ ```bash
254
+ # Convert multiple terminals in a script
255
+ for terminal in ghostty alacritty kitty; do
256
+ console-cowboy --from iterm2 --to-type $terminal > ~/configs/$terminal-config
257
+ done
258
+ ```
259
+
260
+ ## CTEC Format
261
+
262
+ The Common Terminal Emulator Configuration (CTEC) format is a portable YAML representation of terminal settings. It captures:
263
+
264
+ ### Color Scheme
265
+ - Foreground and background colors
266
+ - Cursor and selection colors
267
+ - Full 16-color ANSI palette (normal and bright variants)
268
+
269
+ ### Font Configuration
270
+ - Font family, size, and line height
271
+ - Bold and italic font variants
272
+ - Ligature support
273
+
274
+ ### Cursor Configuration
275
+ - Style (block, beam, underline)
276
+ - Blink behavior and interval
277
+
278
+ ### Window Configuration
279
+ - Initial dimensions (columns/rows)
280
+ - Opacity and blur effects
281
+ - Padding and decorations
282
+ - Startup mode
283
+
284
+ ### Behavior Configuration
285
+ - Default shell
286
+ - Scrollback buffer size
287
+ - Bell mode (audible, visual, none)
288
+ - Copy-on-select behavior
289
+
290
+ ### Key Bindings
291
+ - Keyboard shortcuts with modifiers
292
+
293
+ ### Terminal-Specific Settings
294
+ Settings that cannot be mapped to common CTEC fields are preserved in a `terminal_specific` section, allowing them to be restored when converting back to the same terminal.
295
+
296
+ ### Example CTEC File
297
+
298
+ ```yaml
299
+ version: "1.0"
300
+ source_terminal: ghostty
301
+
302
+ color_scheme:
303
+ name: Tomorrow Night
304
+ foreground: "#c5c8c6"
305
+ background: "#1d1f21"
306
+ cursor: "#c5c8c6"
307
+ black: "#1d1f21"
308
+ red: "#cc6666"
309
+ green: "#b5bd68"
310
+ yellow: "#f0c674"
311
+ blue: "#81a2be"
312
+ magenta: "#b294bb"
313
+ cyan: "#8abeb7"
314
+ white: "#c5c8c6"
315
+
316
+ font:
317
+ family: JetBrains Mono
318
+ size: 14.0
319
+ ligatures: true
320
+
321
+ cursor:
322
+ style: block
323
+ blink: true
324
+ blink_interval: 500
325
+
326
+ window:
327
+ columns: 120
328
+ rows: 40
329
+ opacity: 0.95
330
+
331
+ behavior:
332
+ shell: /bin/zsh
333
+ bell_mode: visual
334
+
335
+ scroll:
336
+ lines: 10000
337
+
338
+ key_bindings:
339
+ - action: Copy
340
+ key: c
341
+ mods:
342
+ - ctrl
343
+ - shift
344
+ ```
345
+
346
+ ## Supported Terminals
347
+
348
+ | Terminal | Config Format | Import | Export | Quick Terminal |
349
+ |----------|--------------|--------|--------|----------------|
350
+ | iTerm2 | plist XML | Yes | Yes | Yes |
351
+ | Ghostty | key=value | Yes | Yes | Yes |
352
+ | Alacritty | TOML/YAML | Yes | Yes | No |
353
+ | Kitty | key value | Yes | Yes | Yes |
354
+ | Wezterm | Lua | Yes | Yes | No |
355
+ | VS Code | JSON | Yes | Yes | No |
356
+ | Terminal.app | plist XML | Yes | Yes | No |
357
+
358
+ ### Default Config Locations
359
+
360
+ - **iTerm2**: `~/Library/Preferences/com.googlecode.iterm2.plist`
361
+ - **Ghostty**: `~/.config/ghostty/config`
362
+ - **Alacritty**: `~/.config/alacritty/alacritty.toml` or `.yml`
363
+ - **Kitty**: `~/.config/kitty/kitty.conf`
364
+ - **Wezterm**: `~/.wezterm.lua` or `~/.config/wezterm/wezterm.lua`
365
+ - **VS Code**: `~/Library/Application Support/Code/User/settings.json` (macOS) or `~/.config/Code/User/settings.json` (Linux)
366
+ - **Terminal.app**: `~/Library/Preferences/com.apple.Terminal.plist`
367
+
368
+ ## Compatibility Notes
369
+
370
+ Not all settings can be perfectly converted between terminals:
371
+
372
+ 1. **Color Formats**: All terminals use slightly different color representations. Console Cowboy normalizes to hex colors (e.g., `#c5c8c6`) compatible with the iTerm2-Color-Schemes format.
373
+
374
+ 2. **Font Handling**: Font names may need adjustment depending on how each terminal resolves fonts.
375
+
376
+ 3. **Key Bindings**: Different terminals have different action names and modifier key representations. Key bindings are converted on a best-effort basis.
377
+
378
+ 4. **Wezterm Lua**: Wezterm uses Lua for configuration. Console Cowboy can parse common patterns but complex Lua configurations may not be fully captured.
379
+
380
+ 5. **Terminal-Specific Features**: Features unique to one terminal (like iTerm2's "Unlimited Scrollback" or Kitty's remote control) are preserved but only work when converting back to the same terminal.
381
+
382
+ 6. **Terminal.app NSKeyedArchiver**: Terminal.app uses Apple's NSKeyedArchiver format for colors and fonts. Console Cowboy can parse this format, but for best accuracy on macOS, installing PyObjC (`uv pip install pyobjc-framework-Cocoa`) is recommended.
383
+
384
+ 7. **Quick Terminal / Hotkey Window**: Quake-style dropdown terminal settings can be migrated between iTerm2, Ghostty, and Kitty. Alacritty, Wezterm, and VS Code don't have native quick terminal support.
385
+
386
+ 8. **VS Code**: VS Code's integrated terminal has limited customization compared to dedicated terminal emulators. Only colors, fonts, cursor, and basic behavior settings are supported.
387
+
388
+ Console Cowboy will report any incompatibilities or settings that couldn't be converted.
389
+
390
+ ## Development
391
+
392
+ To contribute to this tool, first checkout the code:
393
+
394
+ ```bash
395
+ git clone https://github.com/zetlen/console-cowboy
396
+ cd console-cowboy
397
+ ```
398
+
399
+ Install dependencies with [uv](https://docs.astral.sh/uv/) (recommended):
400
+
401
+ ```bash
402
+ uv sync --all-extras
403
+ ```
404
+
405
+ Run the tests:
406
+
407
+ ```bash
408
+ uv run pytest
409
+ ```
410
+
411
+ Run tests with coverage:
412
+
413
+ ```bash
414
+ uv run pytest --cov=console_cowboy
415
+ ```
416
+
417
+ Run the CLI during development:
418
+
419
+ ```bash
420
+ uv run console-cowboy --help
421
+ ```
422
+
423
+ ## License
424
+
425
+ Apache 2.0
426
+
427
+ ## Contributing
428
+
429
+ Contributions are welcome! Repo's open.
430
+
431
+ ### Adding Support for New Terminals
432
+
433
+ 1. Create a new adapter in `console_cowboy/terminals/`
434
+ 2. Inherit from `TerminalAdapter`
435
+ 3. Implement `parse()` and `export()` methods
436
+ 4. Register the adapter in `console_cowboy/terminals/__init__.py`
437
+ 5. Add test fixtures and tests