{"id":34566252,"url":"https://github.com/posit-dev/with-connect","last_synced_at":"2025-12-24T09:06:30.376Z","repository":{"id":320765725,"uuid":"1083212339","full_name":"posit-dev/with-connect","owner":"posit-dev","description":"CLI and GitHub Action for integration testing with Posit Connect","archived":false,"fork":false,"pushed_at":"2025-12-19T15:39:24.000Z","size":55,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-21T21:36:50.014Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"tdstein/with-connect","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/posit-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-10-25T15:10:31.000Z","updated_at":"2025-12-19T15:39:27.000Z","dependencies_parsed_at":"2025-12-19T04:07:45.251Z","dependency_job_id":null,"html_url":"https://github.com/posit-dev/with-connect","commit_stats":null,"previous_names":["nealrichardson/with-connect","posit-dev/with-connect"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/posit-dev/with-connect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fwith-connect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fwith-connect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fwith-connect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fwith-connect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posit-dev","download_url":"https://codeload.github.com/posit-dev/with-connect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fwith-connect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27995609,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2025-12-24T09:05:55.479Z","updated_at":"2025-12-24T09:06:30.370Z","avatar_url":"https://github.com/posit-dev.png","language":"Python","readme":"# with-connect\n\nA CLI tool and GitHub Action for running Posit Connect in Docker and executing commands against it.\n\n## Installation\n\nInstall as a tool using `uv` (recommended):\n\n```bash\nuv tool install git+https://github.com/posit-dev/with-connect.git\n```\n\nOr install from a local clone for development:\n\n```bash\ngit clone https://github.com/posit-dev/with-connect.git\ncd with-connect\nuv tool install -e .\n```\n\n## Requirements\n\n- Python 3.13+, or `uv`\n- Docker\n- A valid Posit Connect license file\n\n## Usage\n\n### Basic Usage\n\nRun Posit Connect with default settings:\n\n```bash\nwith-connect\n```\n\nThis will:\n1. Pull the specified Posit Connect Docker image\n2. Start a container with your license file mounted\n3. Wait for Connect to start\n4. Bootstrap and retrieve an API key\n5. Stop the container\n\n### Running Commands\n\nExecute a command against the running Connect instance:\n\n```bash\nwith-connect -- rsconnect deploy manifest .\n```\n\nCommands after `--` are executed with `CONNECT_API_KEY` and `CONNECT_SERVER` environment variables set.\n\n**Important:** When using the CLI, if you need to run multiple commands or reference the `CONNECT_API_KEY` and `CONNECT_SERVER` environment variables, you must wrap your command in `bash -c` with single quotes:\n\n```bash\nwith-connect -- bash -c 'curl -f -H \"Authorization: Key $CONNECT_API_KEY\" $CONNECT_SERVER/__api__/v1/content'\n```\n\nWithout `bash -c`, the environment variables would be evaluated before `with-connect` defines them.\n\n### Options\n\n| Option        | Default                 | Description                                                                                                          |\n|---------------|-------------------------|----------------------------------------------------------------------------------------------------------------------|\n| `--version`   | `release`               | Posit Connect version. Use \"latest\" or \"release\" for the most recent version, or specify a version like \"2024.08.0\". |\n| `--license`   | `./rstudio-connect.lic` | Path to license file. This file must exist and be a valid Connect license.                                           |\n| `--image`     |                         | Container image to use, including tag (e.g., `posit/connect:2025.12.0`). Overrides `--version`.                      |\n| `--config`    |                         | Path to optional rstudio-connect.gcfg configuration file                                                             |\n| `--port`      | `3939`                  | Port to map the Connect container to. Allows running multiple Connect instances simultaneously.                      |\n| `-e`, `--env` |                         | Environment variables to pass to the Docker container (format: KEY=VALUE). Can be specified multiple times.          |\n\nExample:\n\n```bash\nwith-connect --version 2024.08.0 --license /path/to/license.lic -- rsconnect deploy manifest .\n```\n\nPassing environment variables to the Docker container:\n\n```bash\nwith-connect -e MY_VAR=value -e ANOTHER_VAR=123 -- rsconnect deploy manifest .\n```\n\nYou can use this to override Connect server configuration by passing in `CONNECT_` prefixed variables, following https://docs.posit.co/connect/admin/appendix/configuration/#environment-variables.\n\nIf you need env vars that are useful for the command running after `--`, just set them in the environment from which you call `with-connect`: the command will inherit that environment.\n\n## GitHub Actions\n\nThis project contains a GitHub Action for use in CI/CD workflows. Use the `@v1` tag to get the latest stable version, or `@main` for the development version.\n\nYou will need to store your Posit Connect license file as a GitHub secret (e.g., `CONNECT_LICENSE_FILE`).\n\n### GitHub Action Inputs\n\nThe GitHub Action supports the following inputs:\n\n| Input         | Required | Default   | Description                                                                                   |\n|---------------|----------|-----------|-----------------------------------------------------------------------------------------------|\n| `license`     | Yes      |           | Posit Connect license file contents (store as a GitHub secret)                                |\n| `version`     | No       | `release` | Posit Connect version                                                                         |\n| `image`       | No       |           | Container image to use, including tag (e.g., `posit/connect:2025.12.0`). Overrides `version`. |\n| `config-file` | No       |           | Path to rstudio-connect.gcfg configuration file                                               |\n| `port`        | No       | `3939`    | Port to map the Connect container to                                                          |\n| `quiet`       | No       | `false`   | Suppress progress indicators during image pull                                                |\n| `env`         | No       |           | Environment variables to pass to Docker container (one per line, format: KEY=VALUE)           |\n| `command`     | Yes      |           | Command to run against Connect                                                                |\n\n### Deploy a Connect Manifest\n\n```yaml\nname: Integration tests with Connect\non:\n  push:\n    branches: [main]\n\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v5\n\n      - name: Test deployment\n        uses: posit-dev/with-connect@v1\n        with:\n          version: 2025.09.0\n          license: ${{ secrets.CONNECT_LICENSE_FILE }}\n          command: rsconnect deploy manifest .\n```\n\n### Multiline Commands in GitHub Actions\n\nUnlike the CLI, the GitHub Action automatically wraps commands in `bash -c`, so you can write multiline commands naturally without explicit wrapping:\n\n```yaml\n- name: Run multiple commands\n  uses: posit-dev/with-connect@v1\n  with:\n    version: 2025.09.0\n    license: ${{ secrets.CONNECT_LICENSE_FILE }}\n    command: |\n      echo \"Starting deployment\"\n      rsconnect deploy manifest .\n      curl -f -H \"Authorization: Key $CONNECT_API_KEY\" $CONNECT_SERVER/__api__/v1/content\n      echo \"Deployment complete\"\n```\n\nThe `$CONNECT_API_KEY` and `$CONNECT_SERVER` environment variables are available within your commands.\n\n**Note:** For single-line commands with special characters (like `$` or quotes), wrap the entire command in single quotes to prevent YAML parsing issues:\n\n```yaml\n- name: Single line with special characters\n  uses: posit-dev/with-connect@v1\n  with:\n    version: 2025.09.0\n    license: ${{ secrets.CONNECT_LICENSE_FILE }}\n    command: 'curl -f -H \"Authorization: Key $CONNECT_API_KEY\" $CONNECT_SERVER/__api__/v1/content'\n```\n\n### Set Environment Variables\n\n```yaml\n- name: Test deployment with custom env vars\n  uses: posit-dev/with-connect@v1\n  with:\n    version: 2025.09.0\n    license: ${{ secrets.CONNECT_LICENSE_FILE }}\n    env: |\n      MY_VAR=value\n      ANOTHER_VAR=123\n    command: rsconnect deploy manifest .\n```\n\n### Specify a Custom Container Image\n\n```yaml\n- name: Test deployment with custom image\n  uses: posit-dev/with-connect@v1\n  with:\n    image: rstudio/rstudio-connect:jammy-2025.09.0\n    license: ${{ secrets.CONNECT_LICENSE_FILE }}\n    command: rsconnect deploy manifest .\n```\n\n## Minimum Version\n\nPosit Connect 2022.10.0 or later is required. Earlier versions did not have the bootstrap endpoint used in this utility.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposit-dev%2Fwith-connect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposit-dev%2Fwith-connect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposit-dev%2Fwith-connect/lists"}