{"id":24169670,"url":"https://github.com/fioletoven/b4n","last_synced_at":"2026-05-04T18:01:29.500Z","repository":{"id":270478670,"uuid":"910286046","full_name":"fioletoven/b4n","owner":"fioletoven","description":"Terminal user interface (TUI) for Kubernetes API written in Rust","archived":false,"fork":false,"pushed_at":"2026-04-27T21:26:24.000Z","size":3454,"stargazers_count":73,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-04-27T23:20:48.540Z","etag":null,"topics":["k8s","k8s-cluster","kube-rs","kubernetes","kubernetes-cli","kubernetes-cluster","ratatui","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"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/fioletoven.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-30T22:11:56.000Z","updated_at":"2026-04-26T17:37:49.000Z","dependencies_parsed_at":"2025-01-18T20:17:50.121Z","dependency_job_id":"9d0c67d1-34ee-4532-aaba-f00b2f96b68b","html_url":"https://github.com/fioletoven/b4n","commit_stats":null,"previous_names":["fioletoven/b4n"],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/fioletoven/b4n","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fioletoven%2Fb4n","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fioletoven%2Fb4n/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fioletoven%2Fb4n/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fioletoven%2Fb4n/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fioletoven","download_url":"https://codeload.github.com/fioletoven/b4n/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fioletoven%2Fb4n/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32618391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: 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":["k8s","k8s-cluster","kube-rs","kubernetes","kubernetes-cli","kubernetes-cluster","ratatui","rust"],"created_at":"2025-01-12T23:13:56.367Z","updated_at":"2026-05-04T18:01:29.488Z","avatar_url":"https://github.com/fioletoven.png","language":"Rust","funding_links":[],"categories":["💻 Apps"],"sub_categories":["👨‍💻 System Administration"],"readme":"# b4n\n\n`b4n` is a terminal user interface (TUI) for the Kubernetes API, created mainly for learning the Rust programming language. It is heavily based on the [`k9s` project](https://k9scli.io) and built using the [`kube-rs`](https://kube.rs) and [`ratatui`](https://ratatui.rs) crates.\n\n![b4n demo](assets/b4n.gif?raw=true \"b4n\")\n\n## Prerequisites\n\nThe [Cascadia Code font](https://github.com/microsoft/cascadia-code), or any other font with [Nerd Font](https://www.nerdfonts.com/font-downloads) symbols, is required for proper display of the user interface in the terminal.\n\n## Building\n\nTo build `b4n` ensure you have a recent Rust toolchain installed (1.88+ recommended). Clone the repository and navigate into the project directory:\n\n```bash\ngit clone https://github.com/fioletoven/b4n.git\ncd b4n\n```\n\nThen compile the project in release mode for optimal performance:\n\n```bash\ncargo build --release\n```\n\nThe resulting binary will be available at `./target/release/b4n`.\n\n## Features\n\n### Currently Supported\n\nThe following features are currently supported:\n\n- View and filter a list of Kubernetes resources.\n- Create, read, update, and delete Kubernetes resources.\n- View events for the highlighted resource.\n- View logs for the highlighted pod or container.\n- Open a shell session or attach to the highlighted container's main process.\n- Enable port forwarding for the highlighted container.\n- Mouse support in all views.\n\n### Planned\n\nThe following features are planned for future development:\n\n- File transfer from/to a pod.\n- Custom commands (simple plugin system to run external binaries).\n\n## Default Key Bindings\n\n| Action                                     | Command         | Comments                                                    |\n|:-------------------------------------------|:----------------|:------------------------------------------------------------|\n| Attach to the container's main process     | `a`             | Works only in containers view                               |\n| Attach to the container's shell            | `s`             | Works only in containers view                               |\n| Copy YAML / logs / resources to clipboard  | `c`             | Works only in YAML, logs and resources views                |\n| Create new resource                        | `n`             |                                                             |\n| Decode highlighted secret                  | `x`             |                                                             |\n| Delete selected resources                  | `CTRL` + `d`    | Displays a confirmation dialog                              |\n| Enable / disable mouse support             | `CTRL` + `n`    | Not available inside a shell session                        |\n| Forward container's port                   | `f`             | Works only in containers view                               |\n| Go back to namespaces; clear filter        | `ESC`           | Also clears input in the filter widget                      |\n| Navigate to the involved object            | `i`             | Works only for `events` kind                                |\n| Open / switch to edit mode                 | `i`             | Press `ESC` to exit, then `ESC` for save dialog             |\n| Open right mouse button menu               | `m`             | Navigate using `↑` or `↓`                                   |\n| Pin active filter across resources         | `CTRL` + `p`    | Also works in the filter dialog                             |\n| Quit the application                       | `CTRL` + `c`    | No confirmation dialog                                      |\n| Reverse selection                          | `CTRL` + ` `    | (`CTRL` + `SPACE`)                                          |\n| Select resource                            | ` `             | (`SPACE`)                                                   |\n| Show / hide log timestamps                 | `t`             | Works only in logs view                                     |\n| Show / hide port forwards                  | `CTRL` + `f`    | Displays all active port forwarding rules                   |\n| Show command palette                       | `:`, `\u003e`        | For example, entering `:q`↲ quits the application           |\n| Show describe for the highlighted resource | `d`             |                                                             |\n| Show events for the highlighted resource   | `e`             |                                                             |\n| Show filter / search input                 | `/`             | Filter operators: and `\u0026`, or `\\|`, negation `!`, `(`, `)`  |\n| Show footer messages history pane          | `h`             | Also works with left mouse button click on the footer       |\n| Show logs for the pod or container         | `l`             | Press `p` to display previous logs                          |\n| Show namespaces selector                   | `←`             | To select `all` rapidly press `←` again                     |\n| Show resources selector                    | `→`             | To select `pods` rapidly press `→` again                    |\n| Show YAML for the highlighted resource     | `y`             |                                                             |\n| Sort column                                | `ALT` + `[0-9]` | Also works with `ALT` + `[underlined letter]`               |\n\n## Advanced Filtering\n\nThe resources and port forwards views support advanced filtering with prefixes:\n\n- `ns:` - filter by namespace (e.g., `ns:kube-system`)\n- `n:` - filter by resource name (e.g., `n:nginx`)\n- `a:` - filter by annotations (e.g., `a:app.kubernetes.io/name=nginx`)\n- `l:` - filter by labels (e.g., `l:app=frontend`)\n\nFilters can be combined using logical operators: `\u0026` (and), `|` (or), `!` (negation), and parentheses `()`.\n\nExample: `ns:default \u0026 (l:app=web | l:app=api)`\n\n\u003e Note: `CTRL` + `p` will pin the active filter across resource changes\n\n## Logs View\n\nWhen viewing logs for a single container, you can fetch earlier log entries by pressing the `↑` (up arrow) key. This feature is only available when you are scrolled to the top of the currently displayed logs and there are additional log entries available before the first visible line.\n\n\u003e Note: This functionality works only in single container logs view, not when viewing combined logs for all containers in a pod.\n\n## Text Selection and Editing\n\nWhen mouse support is enabled, you can:\n\n- **Select text** by clicking and dragging in YAML, logs, shell, and attach view\n- **Select whole words** by double-clicking\n- **Select whole lines** by triple-clicking\n- **Copy selected text** to clipboard using standard key bindings\n\nIn edit mode, the following shortcuts are available:\n\n- `CTRL` + `c` - copy selected text\n- `CTRL` + `x` - cut selected text\n- `CTRL` + `v` - paste text from clipboard\n- `CTRL` + `a` - select all text\n- `CTRL` + `d` - delete current line\n- `CTRL` + `z` - undo\n- `CTRL` + `y` - redo\n- `ALT`  + `↑` - move current line up\n- `ALT`  + `↓` - move current line down\n\n\u003e Note: These shortcuts currently cannot be changed in the `key_bindings` configuration section\n\n## Configuration Files\n\nConfiguration files are stored in the `$HOME/.b4n` directory. The directory structure is as follows:\n\n```\n.b4n/\n├─ logs/\n├─ themes/\n│  └─ default.yaml\n├─ config.yaml\n└─ history.yaml\n```\n\n### logs/\n\nThis directory contains application logs, with one log file generated per day.\n\n### themes/\n\nThis folder stores all TUI (Text User Interface) themes.  \nThe `default.yaml` theme will be automatically generated by the application if it doesn't already exist.\n\nYou can place additional theme files here by copying them from the `themes` folder or creating your own.\n\n### config.yaml\n\nThis file contains configuration settings that control the behaviour of the `b4n` application.  \nHere is an example structure:\n\n```yaml\nlogs:\n  lines: 800\n  timestamps: true\nmouse: true\ntheme: light\ncontexts:\n  test-cluster: '#43464f:#8aad81'\n  production: '#d8d8d8:#e1140a'\naliases:\n  daemonsets: ds,dms\n  namespace: nn\n  namespaces: ns,na,nam\n  services: svc\nkey_bindings:\n  action.name: list of key bindings for that action\n  command-palette.open: :, \u003e, Shift+:, Shift+\u003e\n  [...]\n```\n\n#### Configuration Options\n\n- `logs.lines` - The number of log lines to retrieve from the Kubernetes API for the selected container.\n- `logs.timestamps` - Indicates whether timestamps are enabled by default for logs; this setting can still be toggled while viewing the logs.\n- `mouse` - Indicates if mouse support should be enabled when the application starts. Mouse support can also be toggled while the app is running.\n- `theme` - The name of the currently selected theme. This should match a file in the `themes` directory (without the `.yaml` extension).\n- `contexts` - _(Optional)_ A map of context names to their corresponding colors. Useful for highlighting important Kubernetes clusters with distinct header colors.\n- `aliases` - Command palette aliases.\n- `key_bindings` - Defines custom key bindings for various application actions.  \n  Example key bindings: `Ctrl+C`, `Ctrl+Alt+A`, `F7`, `Z`, `Left`, `Enter`.\n\n\u003e Note: If `config.yaml` does not exist, the application will create it automatically with default values.\n\n### history.yaml\n\nThis file stores history for filters, search patterns, and the last selected resource for each Kubernetes context.\nTo remove history entries (either for a specific context or entirely), you can manually edit this file or even delete it.  \nHistory entries can also be deleted from the UI, just highlight one and press `Ctrl+D` to delete it.\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffioletoven%2Fb4n","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffioletoven%2Fb4n","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffioletoven%2Fb4n/lists"}