{"id":19113468,"url":"https://github.com/fielding/iterm2browser","last_synced_at":"2026-02-27T08:31:56.178Z","repository":{"id":143061271,"uuid":"108001196","full_name":"fielding/iterm2browser","owner":"fielding","description":"Convert iterm color schemes to browser usable styles (css, json, less)","archived":false,"fork":false,"pushed_at":"2015-04-02T11:23:22.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T17:45:18.603Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fielding.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-23T15:27:57.000Z","updated_at":"2018-03-13T15:20:45.000Z","dependencies_parsed_at":"2023-03-16T09:21:42.412Z","dependency_job_id":null,"html_url":"https://github.com/fielding/iterm2browser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fielding/iterm2browser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fielding%2Fiterm2browser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fielding%2Fiterm2browser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fielding%2Fiterm2browser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fielding%2Fiterm2browser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fielding","download_url":"https://codeload.github.com/fielding/iterm2browser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fielding%2Fiterm2browser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29888173,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T07:54:54.515Z","status":"ssl_error","status_checked_at":"2026-02-27T07:54:49.177Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T04:36:24.390Z","updated_at":"2026-02-27T08:31:56.164Z","avatar_url":"https://github.com/fielding.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iterm2browser\n\niterm2browser is a command line tool to convert iterm color schemes to styles you can use in the browser. It outputs css, json, and less variables.\n\nThere are 2 types of css output. The first is formatted to be used with [ansi_up](https://github.com/drudru/ansi_up/). The second is formatted to be used with [term.js](https://github.com/chjj/term.js) / [tty.js](https://github.com/chjj/tty.js/)\n\niterm2browser is basically a wrapper around [iterm-colors](https://www.npmjs.com/package/iterm-colors) that outputs to template files.\n\nYou can find some converted styles [here](https://github.com/demille/ansi-browser-styles) with a [demo](https://demille.github.io/ansi-browser-styles) of them in action.\n\n### Install\n```\nnpm install -g iterm2browser\n```\n\n### Usage\n\n```\nUsage: iterm2browser \u003ccommand\u003e [options] \u003cfile/URL\u003e \u003coutput\u003e\n\nOptions:\n\n  -h, --help           output usage information\n  -V, --version        output the version number\n  -p, --prefix [name]  Add a prefix to the output\n  -a, --append         Append to output file\n\nCommands:\n\n  css      Convert to css\n  termjs   Convert to term.js compatible css\n  json     Convert to a json representation\n  less     Convert to less variables\n```\n\nThe prefix command is useful for adding css classes to styles. See output format below.\n\nThe append flag will append styles to the output file. Without, it will write over the output file.\n\n\n### Examples\n```\niterm2browser css cobalt2.itermcolors cobalt2.css\n\niterm2browser css --append ir_black.itermcolors styles.css\n\niterm2browser less http://github.com/that/style/there that.less\n```\n\n### Output Formats\n\n**CSS Output** \u003cbr/\u003e\nProvides these styles: \u003cbr/\u003e\n- `.fg`\n- `.bg`\n- `::selection`\n- `.ansi-{color}-fg`, `.ansi-{color}-bg`, `.ansi-bright-{color}-fg`, and `.ansi-bright-{color}-bg` for black, red, green, yellow, blue, magenta, cyan, and white\n\nPrefixes are applied this pattern: `{{ prefix }} .fg`\n\nSo `iterm2browser css --prefix=\".cobalt2\" cobalt2.itermcolors cobalt2.css` would output: `.cobalt2 .fg {...}`\n\n\n**Termjs Output** \u003cbr/\u003e\nYou can set termjs colors when you start a terminal with json, but how do you change it on the fly, whenever you want? Nasty hacks, thats how. Termjs css output looks like this: \u003cbr/\u003e\n`{{ prefix }} span[style*=\";color:#eeeeec;\"] {color: {{ theme_color }} !important;}`\n\nIt works by overriding the default inline styles termjs sets for fg and bg colors. Nasty. It also provides .fg and .bg like the normal css output.\n\n**JSON Output** \u003cbr/\u003e\nFollows this pattern (without the outer prefix level if it is omitted):\n```json\n{\n  \"{{prefix}}\": {\n    \"fg\":            \"{{ c.foreground }}\",\n    \"bg\":            \"{{ c.background }}\",\n    \"black\":         \"{{ c.palette.0 }}\",\n    \"red\":           \"{{ c.palette.1 }}\",\n    \"green\":         \"{{ c.palette.2 }}\",\n    \"yellow\":        \"{{ c.palette.3 }}\",\n    \"blue\":          \"{{ c.palette.4 }}\",\n    \"magenta\":       \"{{ c.palette.5 }}\",\n    \"cyan\":          \"{{ c.palette.6 }}\",\n    \"white\":         \"{{ c.palette.7 }}\",\n    \"brightBlack\":   \"{{ c.palette.8 }}\",\n    \"brightRed\":     \"{{ c.palette.9 }}\",\n    \"brightGreen\":   \"{{ c.palette.10 }}\",\n    \"brightYellow\":  \"{{ c.palette.11 }}\",\n    \"brightBlue\":    \"{{ c.palette.12 }}\",\n    \"brightMagenta\": \"{{ c.palette.13 }}\",\n    \"brightCyan\":    \"{{ c.palette.14 }}\",\n    \"brightWhite\":   \"{{ c.palette.15 }}\"\n  }\n}\n```\n\n**LESS Output** \u003cbr/\u003e\nOutputs color variables you can use elsewhere. \u003cbr/\u003e\nFollows this format: `@{{prefix}}brightRed` using the same variable names as the JSON output.\n\n### Custom Formats\n\nIf you want to add or change a format, you can add or edit a .mustache template in lib/templates.  Compile the template with the [Hogan](http://twitter.github.io/hogan.js/)'s hulk command:\n\n```\nhulk *.mustache \u003e compiled.js\n```\n\nIf your template was named mine.mustache, you would then run iterm2browser with the `mine` command:\n\n```\niterm2browser mine cobalt2.itermcolors cobalt2.css\n```\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Sterling DeMille \u0026lt;sterlingdemille@gmail.com\u0026gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffielding%2Fiterm2browser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffielding%2Fiterm2browser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffielding%2Fiterm2browser/lists"}