Visitar URL original
Split CLI into separate binary by JakeStanger · Pull Request #1690 · JakeStanger/ironbar · GitHub
Skip to content

Split CLI into separate binary - #1690

Open
JakeStanger wants to merge 1 commit into
masterfrom
refactor/cli-split
Open

JakeStanger wants to merge 1 commit into
masterfrom
refactor/cli-split

Conversation

@JakeStanger

Copy link
Copy Markdown
Owner

Splits out the CLI into its own ironbar-cli crate. The CLI uses the ironbar binary name, and the bar is moved to ironbard.

The CLI works as a proxy, and has exactly the same interface as the current binary. Executing just ironbar (or any command without sub-commands) will forward to start the bar, whereas other requests stay within the CLI executable.

By keeping IPC calls inside the CLI executable, it avoids the need to load the GTK libraries, which takes an approximate forever. This leads to an approximate 30x speedup in IPC commands, and a 7x reduction in memory needed.

A benchmark from the WIP version shows this:

image

The PR also introduces several other helper crates, mostly out of necessity to decouple the code in order to extract the CLI in the first place. These are:

  • ironbar-core - some central shared types.
  • ironbar-args - the CLI argument types, as these are needed by both the CLI and main bar.
  • ironbar-ipc-types - the command/response definitions for IPC, and base struct.

The latter is exciting as it'll mean the IPC defintions will be published properly for the first time as a standalone crate, allowing rust-based integrations to be easily made.

Resolves #1687
Related: #1488


Quite a bit of work to be done here still and some decisions to be made, but this works so publishing.

@JakeStanger
JakeStanger force-pushed the refactor/cli-split branch 9 times, most recently from 3047d12 to a1da388 Compare November 4, 2026 21:58
@JakeStanger
JakeStanger marked this pull request as ready for review November 7, 2026 16:08
@github-actions github-actions Bot added the Z:Review Required Pull request pending review label Nov 7, 2026
@JakeStanger
JakeStanger force-pushed the refactor/cli-split branch 3 times, most recently from f386de5 to f7ef502 Compare November 7, 2026 16:33
Comment thread docs/Development guide.md

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to check & sort compilation flags

Introduces several helper crates, with the CLI moved to its own binary taking the `ironbar` name. The main bar now lives at `ironbard`, which the CLI will forward the `exec` to when appropriate.

By moving the CLI into its own binary, it improves the startup time by over 30x, which means faster IPC communication.

Resolves #1687
Related: #1488
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Z:Review Required Pull request pending review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI startup time is slow

1 participant