{"slug": "how-to-setup-bee-cli-beeai-cli-on-your-ubuntu-24-04", "title": "How to setup Bee CLI (@beeai/cli) on your Ubuntu 24.04", "summary": "A developer documented setting up Bee's command-line interface (@beeai/cli) on Ubuntu 24.04, installing it via npm or mise and wiring it to GNOME Keyring through the Secret Service D-Bus API so the CLI can store credentials. The setup includes a user-level systemd keyring service, enabling lingering, and authenticating with `bee login --qr`, after which conversation data can be pulled from the terminal with commands like `bee conversations list` and `bee conversations get <ID> --json` for use in other tools, including AI harnesses.", "body_md": "After attending an AWS re:Invent session(AMZ202-R) about Bee, I became very interested in it as a note-taking product that I could use through a CLI.\n\nBee is a wearable note-taking device and service that records conversations and makes them available in the Bee app. Bee also provides a command-line interface, [`@beeai/cli`](https://docs.bee.computer/docs), for accessing that data from a terminal. That makes it possible to bring Bee conversations into other tools—including AI harnesses.\n\nHere’s how I set up Bee CLI on Ubuntu 24.04.\n\nInstall the CLI with npm:\n\n```\nnpm install -g @beeai/cli\n```\n\nOr use mise:\n\n```\nmise use -g npm:@beeai/cli\n```\n\nThe CLI needs access to a Secret Service keyring to store credentials. On Ubuntu, I used GNOME Keyring.\n\nInstall GNOME Keyring and the command-line tools for Secret Service:\n\n```\nsudo apt install -y gnome-keyring libsecret-tools\n```\n\nStart a temporary D-Bus session:\n\n```\ndbus-run-session -- bash\n```\n\nInside that shell, unlock GNOME Keyring. Replace the example with your own keyring password; don’t use the example value below:\n\n```\n PW='your-keyring-password' # 1st letter space is avoiding history\nprintf '%s' \"$PW\" | gnome-keyring-daemon --unlock --components=secrets\nunset PW\n```\n\nStore a test value and retrieve it:\n\n```\nprintf '%s' 'test-value' | secret-tool store --label='Test' app keyring-test\nsecret-tool lookup app keyring-test\n```\n\nThe lookup should print:\n\n```\ntest-value\n```\n\nI also checked that the keyring files had been created:\n\n```\nls ~/.local/share/keyrings/\n```\n\nThen exit the temporary D-Bus session:\n\n```\nexit\n```\n\nAfter logging in again, connect to the user D-Bus and unlock GNOME Keyring:\n\n```\nexport DBUS_SESSION_BUS_ADDRESS=\"unix:path=$XDG_RUNTIME_DIR/bus\"\n\n PW='your-keyring-password' # 1st letter space is avoiding history\nprintf '%s' \"$PW\" | gnome-keyring-daemon --foreground --unlock --components=secrets &\nunset PW\n```\n\nConfirm that the Secret Service login collection is available:\n\n```\nbusctl --user tree org.freedesktop.secrets | grep /login$\n```\n\nI saw this path in the output:\n\n```\n/org/freedesktop/secrets/collection/login\n```\n\nTo start GNOME Keyring as a user systemd service, create `keyring.service`:\n\n```\ncat << '_EOT_' | SYSTEMD_EDITOR=tee systemctl --user edit --full --force keyring.service\n[Unit]\nDescription=GNOME Keyring Secret Service\nRequires=dbus.socket\nAfter=dbus.socket\n\n[Service]\nType=dbus\nBusName=org.freedesktop.secrets\nEnvironment=DBUS_SESSION_BUS_ADDRESS=unix:path=%t/bus\nExecStart=/usr/bin/gnome-keyring-daemon --foreground --unlock --components=secrets\nStandardInput=file:%h/.config/gnome-keyring/password\nRestart=on-failure\n\n[Install]\nWantedBy=default.target\n_EOT_\n```\n\nThis service reads the keyring password from `~/.config/gnome-keyring/password`. That file contains a secret, so keep it private and restrict access to it.\n\nStop any already-running keyring daemon, then enable and start the service:\n\n```\npkill -u \"$(id -u)\" -x gnome-keyring-d || true\nsystemctl --user enable --now keyring.service\n```\n\nTest Secret Service again:\n\n```\nsecret-tool lookup app keyring-test\n```\n\nThe expected output is still:\n\n```\ntest-value\n```\n\nTo keep user services running when you’re not logged in, enable lingering and reboot:\n\n```\nsudo loginctl enable-linger \"$USER\"\nsudo systemctl reboot\n```\n\nAfter the reboot, log in to Bee:\n\n```\nbee login --qr\n```\n\nCheck that the CLI can access your profile:\n\n```\nbee me\n```\n\nMy profile output included my timezone and name. `bee status` is also available to check the CLI’s authentication status.\n\nBee CLI can retrieve conversation data from the terminal. For example:\n\n```\nbee conversations list\nbee conversations get <CONVERSATION_ID> --json\n```\n\nI’ll add a screenshot here showing the CLI being called from an AI harness.\n\n**[Screenshot: AI harness calling Bee CLI]**\n\nThis setup gives Bee CLI access to GNOME Keyring through Ubuntu’s Secret Service, and makes Bee conversation data available to other command-line tools.", "url": "https://wpnews.pro/news/how-to-setup-bee-cli-beeai-cli-on-your-ubuntu-24-04", "canonical_source": "https://dev.to/ma2shita/how-to-setup-bee-cli-beeaicli-on-your-ubuntu-2404-cpi", "published_at": "2026-11-30 22:35:34+00:00", "updated_at": "2026-11-30 22:44:38.574841+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools"], "entities": ["Bee", "@beeai/cli", "Ubuntu 24.04", "GNOME Keyring", "AWS re:Invent", "npm", "mise", "systemd"], "also_reported_by": [], "takeaway": "On Ubuntu 24.04, Bee CLI's credential storage requires a running Secret Service, which can be provided by unlocking GNOME Keyring inside a D-Bus session and then persisting it as a user systemd service reading the password from a restricted file.", "recommendation": {"advice": "Run GNOME Keyring as a user systemd service with lingering enabled so the Secret Service stays available for CLI credential storage, and restrict permissions on the password file it reads.", "playbook": "production-ops", "playbook_url": "https://wpnews.pro/playbooks/production-ops"}, "alternates": {"html": "https://wpnews.pro/news/how-to-setup-bee-cli-beeai-cli-on-your-ubuntu-24-04", "markdown": "https://wpnews.pro/news/how-to-setup-bee-cli-beeai-cli-on-your-ubuntu-24-04.md", "text": "https://wpnews.pro/news/how-to-setup-bee-cli-beeai-cli-on-your-ubuntu-24-04.txt", "jsonld": "https://wpnews.pro/news/how-to-setup-bee-cli-beeai-cli-on-your-ubuntu-24-04.jsonld"}}