# rl-cli
A command line utility for interacting with runloop APIs.
**NOTE: This project is still in early alpha release**
# Setup
## Install using pipx
```
➜ ~ pipx install rl-cli
installed package rl-cli 0.0.1, installed using Python 3.12.6
These apps are now globally available
```
## For developers
```commandline
# Clone the repo
mkdir -p ~/source/ && cd ~/source/
git clone https://github.com/runloopai/rl-cli.git
cd rl-cli/
# Setup the venv and dev tools
python3 -m venv .venv && source .venv/bin/activate && pip install -r dev-requirements.txt
# Install to your venv with flink
# Use 'which python3' to find your system python
flit install --symlink --python </path/to/system/python>
# Install to your venv using pip
pip install rl-cli
```
```
# In a new terminal
export RUNLOOP_API_KEY=<your-api-key>
rl --help
```
# Quick reference
## Devbox
### Create a devbox and run a single command
```commandline
rl devbox create --env_vars HELLO=world --entrypoint 'echo $HELLO'
>
create devbox={
"id": "dbx_2xMDUOsKMiZBYKsvSRtMA",
"blueprint_id": null,
"create_time_ms": 1723229557715,
"end_time_ms": null,
"initiator_id": null,
"initiator_type": "invocation",
"name": null,
"status": "provisioning"
}
```
### Observe logs
```commandline
rl devbox logs --id dbx_2xMDUOsKMiZBYKsvSRtMA
>
2024-08-09 12:15:01.701 Initializing devbox...
2024-08-09 12:15:01.734 Devbox setup complete
2024-08-09 12:15:01.769 [entrypoint] -> echo $HELLO
2024-08-09 12:15:01.798 [entrypoint] world
2024-08-09 12:15:01.798 world
2024-08-09 12:15:01.800 [entrypoint] -> exit_code=0
```
### Check the devbox status
```commandline
rl devbox get --id dbx_2ws7IOtjxnJgLsBIpU9nn
>
# Note that the devbox status="shutdown" after the entrypoint completes.
devbox={
"id": "dbx_2xMDUOsKMiZBYKsvSRtMA",
"blueprint_id": null,
"create_time_ms": 1723229557715,
"end_time_ms": 1723229561620,
"initiator_id": null,
"initiator_type": "invocation",
"name": null,
"status": "shutdown"
}
```
### Use scp to copy files to/from the devbox
```commandline
To use the SCP command:
rl devbox scp local_file.txt :remote_file.txt --id <devbox_id>
To copy a file from the devbox to your local machine:
rl devbox scp :remote_file.txt local_file.txt --id <devbox_id>
```
### Use rsync to copy files to/from the devbox
```commandline
To use the rsync command:
rl devbox rsync local_file.txt :remote_file.txt --id <devbox_id>
To copy a file from the devbox to your local machine:
rl devbox rsync :remote_file.txt local_file.txt --id <devbox_id>
Note that the rsync implementation will recurse by default and copy directory contents.
To use the rsync command:
rl devbox rsync local_dir :remote_dir --id <devbox_id>
```
### Use port forwarding to create a tunnel to remote devbox
```commandline
To use the tunnel command:
rl devbox tunnel --id <devbox_id> <local_port>:<remote_port>
Note that this is a blocking command that will block for duration of tunnel.
```
Raw data
{
"_id": null,
"home_page": null,
"name": "rl_cli",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Runloop AI <eng+cli@runloop.ai>",
"download_url": "https://files.pythonhosted.org/packages/99/0f/057ea74cf770d9e0059b704a6cdc222d1644effc207c3ba2b0df397c9ec9/rl_cli-0.2.6.tar.gz",
"platform": null,
"description": "# rl-cli\nA command line utility for interacting with runloop APIs.\n\n**NOTE: This project is still in early alpha release**\n\n# Setup\n\n## Install using pipx\n\n```\n\u279c ~ pipx install rl-cli\n installed package rl-cli 0.0.1, installed using Python 3.12.6\n These apps are now globally available\n```\n\n## For developers\n```commandline\n# Clone the repo\nmkdir -p ~/source/ && cd ~/source/\ngit clone https://github.com/runloopai/rl-cli.git\ncd rl-cli/\n\n# Setup the venv and dev tools\npython3 -m venv .venv && source .venv/bin/activate && pip install -r dev-requirements.txt\n\n# Install to your venv with flink\n# Use 'which python3' to find your system python\nflit install --symlink --python </path/to/system/python>\n\n# Install to your venv using pip\npip install rl-cli\n```\n\n```\n# In a new terminal\nexport RUNLOOP_API_KEY=<your-api-key>\nrl --help\n```\n\n# Quick reference\n\n## Devbox\n\n### Create a devbox and run a single command\n```commandline\nrl devbox create --env_vars HELLO=world --entrypoint 'echo $HELLO'\n>\ncreate devbox={\n \"id\": \"dbx_2xMDUOsKMiZBYKsvSRtMA\",\n \"blueprint_id\": null,\n \"create_time_ms\": 1723229557715,\n \"end_time_ms\": null,\n \"initiator_id\": null,\n \"initiator_type\": \"invocation\",\n \"name\": null,\n \"status\": \"provisioning\"\n}\n```\n\n### Observe logs\n```commandline\nrl devbox logs --id dbx_2xMDUOsKMiZBYKsvSRtMA\n>\n2024-08-09 12:15:01.701 Initializing devbox...\n2024-08-09 12:15:01.734 Devbox setup complete\n2024-08-09 12:15:01.769 [entrypoint] -> echo $HELLO\n2024-08-09 12:15:01.798 [entrypoint] world\n2024-08-09 12:15:01.798 world\n2024-08-09 12:15:01.800 [entrypoint] -> exit_code=0\n```\n\n### Check the devbox status\n```commandline\nrl devbox get --id dbx_2ws7IOtjxnJgLsBIpU9nn\n> \n# Note that the devbox status=\"shutdown\" after the entrypoint completes.\ndevbox={\n \"id\": \"dbx_2xMDUOsKMiZBYKsvSRtMA\",\n \"blueprint_id\": null,\n \"create_time_ms\": 1723229557715,\n \"end_time_ms\": 1723229561620,\n \"initiator_id\": null,\n \"initiator_type\": \"invocation\",\n \"name\": null,\n \"status\": \"shutdown\"\n}\n```\n\n### Use scp to copy files to/from the devbox\n```commandline\nTo use the SCP command:\n rl devbox scp local_file.txt :remote_file.txt --id <devbox_id>\n\nTo copy a file from the devbox to your local machine:\n rl devbox scp :remote_file.txt local_file.txt --id <devbox_id>\n```\n\n### Use rsync to copy files to/from the devbox\n```commandline\nTo use the rsync command:\n rl devbox rsync local_file.txt :remote_file.txt --id <devbox_id>\n\nTo copy a file from the devbox to your local machine:\n rl devbox rsync :remote_file.txt local_file.txt --id <devbox_id>\n\nNote that the rsync implementation will recurse by default and copy directory contents.\n\nTo use the rsync command:\n rl devbox rsync local_dir :remote_dir --id <devbox_id>\n```\n\n### Use port forwarding to create a tunnel to remote devbox\n```commandline\nTo use the tunnel command:\n rl devbox tunnel --id <devbox_id> <local_port>:<remote_port>\n\nNote that this is a blocking command that will block for duration of tunnel.\n```",
"bugtrack_url": null,
"license": null,
"summary": "Runloop CLI for interacting with the Runloop APIs.",
"version": "0.2.6",
"project_urls": {
"Documentation": "https://docs.runloop.ai",
"Home": "https://www.runloop.ai",
"Source": "https://github.com/runloopai/rl-cli"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "61a7f304afb56e88b2094d008f64311f9da68980f20d43d41afd6084894b859b",
"md5": "45248fc88acfd6d5e4510ca6cba45b7b",
"sha256": "b70bbcd04cf3af807fb6bb9f448ebbd844fcf62d8c2f16d8b026743854ef15cb"
},
"downloads": -1,
"filename": "rl_cli-0.2.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "45248fc88acfd6d5e4510ca6cba45b7b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 9276,
"upload_time": "2025-02-07T00:11:15",
"upload_time_iso_8601": "2025-02-07T00:11:15.018683Z",
"url": "https://files.pythonhosted.org/packages/61/a7/f304afb56e88b2094d008f64311f9da68980f20d43d41afd6084894b859b/rl_cli-0.2.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "990f057ea74cf770d9e0059b704a6cdc222d1644effc207c3ba2b0df397c9ec9",
"md5": "7f56a96088baf28abc37e01635109ded",
"sha256": "c21d2bfb4ff8eb6ee151585d27454aa97b1ce36adfad71401f1f3a6bcd0246db"
},
"downloads": -1,
"filename": "rl_cli-0.2.6.tar.gz",
"has_sig": false,
"md5_digest": "7f56a96088baf28abc37e01635109ded",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 27481,
"upload_time": "2025-02-07T00:11:16",
"upload_time_iso_8601": "2025-02-07T00:11:16.886534Z",
"url": "https://files.pythonhosted.org/packages/99/0f/057ea74cf770d9e0059b704a6cdc222d1644effc207c3ba2b0df397c9ec9/rl_cli-0.2.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-07 00:11:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "runloopai",
"github_project": "rl-cli",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "annotated-types",
"specs": [
[
"==",
"0.7.0"
]
]
},
{
"name": "anyio",
"specs": [
[
"==",
"4.8.0"
]
]
},
{
"name": "certifi",
"specs": [
[
"==",
"2024.12.14"
]
]
},
{
"name": "charset-normalizer",
"specs": [
[
"==",
"3.4.1"
]
]
},
{
"name": "distro",
"specs": [
[
"==",
"1.9.0"
]
]
},
{
"name": "h11",
"specs": [
[
"==",
"0.14.0"
]
]
},
{
"name": "httpcore",
"specs": [
[
"==",
"1.0.7"
]
]
},
{
"name": "httpx",
"specs": [
[
"==",
"0.28.1"
]
]
},
{
"name": "idna",
"specs": [
[
"==",
"3.10"
]
]
},
{
"name": "pydantic",
"specs": [
[
"==",
"2.10.5"
]
]
},
{
"name": "pydantic-core",
"specs": [
[
"==",
"2.27.2"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.32.3"
]
]
},
{
"name": "runloop-api-client",
"specs": [
[
"==",
"0.13.0"
]
]
},
{
"name": "sniffio",
"specs": [
[
"==",
"1.3.1"
]
]
},
{
"name": "typing-extensions",
"specs": [
[
"==",
"4.12.2"
]
]
},
{
"name": "urllib3",
"specs": [
[
"==",
"2.3.0"
]
]
}
],
"lcname": "rl_cli"
}