{"id":19040821,"url":"https://github.com/cloudfoundry/capi-workspace","last_synced_at":"2025-08-10T06:35:54.929Z","repository":{"id":29621061,"uuid":"114909858","full_name":"cloudfoundry/capi-workspace","owner":"cloudfoundry","description":"Machine setup for CAPI developers","archived":false,"fork":false,"pushed_at":"2025-07-21T19:13:22.000Z","size":554,"stargazers_count":8,"open_issues_count":11,"forks_count":9,"subscribers_count":35,"default_branch":"main","last_synced_at":"2025-07-21T19:33:18.765Z","etag":null,"topics":["brewfile","capi","dotfiles","setup","team","workspace","workstation"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudfoundry.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2017-12-20T16:45:03.000Z","updated_at":"2025-07-21T19:13:26.000Z","dependencies_parsed_at":"2024-02-07T01:46:29.310Z","dependency_job_id":"739e4dad-e168-443a-9bd5-cf2d76dd82ea","html_url":"https://github.com/cloudfoundry/capi-workspace","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cloudfoundry/capi-workspace","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry%2Fcapi-workspace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry%2Fcapi-workspace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry%2Fcapi-workspace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry%2Fcapi-workspace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudfoundry","download_url":"https://codeload.github.com/cloudfoundry/capi-workspace/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry%2Fcapi-workspace/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269687927,"owners_count":24459389,"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-08-10T02:00:08.965Z","response_time":71,"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":["brewfile","capi","dotfiles","setup","team","workspace","workstation"],"created_at":"2024-11-08T22:25:36.813Z","updated_at":"2025-08-10T06:35:54.903Z","avatar_url":"https://github.com/cloudfoundry.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## CAPI Workstation Helpers 🐋\n\nHello there! This repo is intended to help with development work on CAPI\nprojects.\n\n![capi](https://im-01.gifer.com/9Y0s.gif)\n\n\n## Directory Overview\n\nDescription of the folders in this project:\n\nFolder           | Description\n---------------- | -----------\nassets           | random static files\nbash-it          | all the [bash-it](https://github.com/Bash-it/bash-it) stuff, only bash-it stuff\nhelpers          | random helper files\nlib              | scripts that could be sourced into your shell\nbin              | scripts that can be added to your `$PATH`\ninstall-scripts  | executable scripts that install a thing or two\n\nWhy is `lib` separate from `bash-it`? Not everyone uses bash-it, so `lib` is\nsimilar to `scripts`, giving people a way to manually load the things they care\nabout in.\n\n## Minimal Install\n\nOne may manually (and minimally) load in capi-workspace content by including\nthe following in their `~/.zshrc` (or equivalent):\n\n```bash\nsource \u003c(cat $HOME/workspace/capi-workspace/lib/*) \u003e /dev/null\npath+=(\"$HOME/workspace/capi-workspace/bin\")\n```\n\n## CAPI Helper Commands\n\nThis table is generated from `assets/capidoc.yml`. It is dynamically available\nin your terminal using the `capi` command.\n\n```\nbackup-restore\n    compare_db_rows     \t\t Compares counts of two db's rows to validate backup \u0026 restore\nbosh-deploy\n    create_and_deploy   \t\t Create a capi release, upload to current bosh target, and deploy with default ops files (interactive)\n    create_and_upload   \t\t Create a capi release and upload to current bosh target\n    deploy              \t\t Create a capi release, upload to current bosh target, and deploy with default ops files (non interactive)\n    deploy_only_new_capi \t\t Deploy just the current CAPI to current bosh target\n    quick_deploy        \t\t Quickly upload changes in cloud_controller_ng to relevant vms and restart\"\nbosh-lite-pool\n    attach_debugger     \t\t Attaches the rubymine debugger to your bosh lite\n    bootstrap_cf        \t\t Target a CF, creates an org, space, and targets them\n    cf_admin_password   \t\t Get the CF admin password for a current bosh target (requires credhub)\n    cfu                 \t\t Alias for seed_users\n    claim_bosh_lite     \t\t Claim an available bosh lite CF\n    mysql_bosh_lite     \t\t Connect to current bosh target's MySQL DB\n    print_env_info      \t\t List all the claimed bosh-lites in the pool\n    psql_bosh_lite      \t\t Connect to current bosh target's MySQL DB\n    rebootstrap_cf      \t\t Delete the 'org' org then call bootstrap_cf. For cleaning the slate.\n    seed_users          \t\t Add users of every role to the current org and space\n    target_bosh         \t\t Target a bosh environment from the pool\n    target_cf           \t\t Change cf cli target to the cloud foundry deployed on currently targeted bosh (hint: use \"target_bosh\" first).\n    target_uaa          \t\t Change uaac target to currently targeted bosh and login as admin\n    unclaim_bosh_lite   \t\t Return a bosh lite CF back to the pool\n    which_bosh          \t\t Print which bosh environment is currently targeted\ncapi-release-author\n    sync_package_specs  \t\t Add go submodule dependencies to bosh package specs\n    sync_submodule_config \t\t Sync git submodules with go dependencies using gosub\n    unused_blobs        \t\t Detects unused blobs from the blobs.yml file\nfile-system\n    v                   \t\t Open matching location in vim (fasd -e vim)\n    z                   \t\t Change current directory to directory matching provided pattern (ex: z ng)\ngit\n    fixcommitter        \t\t Cleans up committer/author after a rebase\n    g                   \t\t git status\n    gd                  \t\t git diff\n    gdc                 \t\t git diff --cached\n    git-open            \t\t Open a git repo in your browser, courtesy of Paul Irish.\n    pullify             \t\t Pull down all PRs for current git repo as branches\n    staged_shortlog     \t\t Get commit shortlogs and authors from submodule changes\n    update              \t\t Update all the git submodules\n    which_capi          \t\t Given a cloud_controller_ng commit, print which version of capi-release it first appears in\nruby-dev\n    b                   \t\t bundle exec\n    bake                \t\t bundle exec rake\n    gi                  \t\t gem install\n    mybake              \t\t DB=mysql bundle exec rake\n    pgbake              \t\t DB=postgres bundle exec rake\ntesting\n    baras               \t\t Runs baras with local integration_config\n    cats                \t\t Runs cats with local integration_config\n    cats_cleanup        \t\t Deletes builpacks, orgs, quotes, and service brokers in a targeted CF\n    check_certificate_expirations \t\t Reads YAML files, checks for expired (or premature) certs. Useful for pipeline troubleshooting\n    delete_orgs         \t\t Delete all orgs for current cf target\n    generate_integration_config \t\t Create an integration_config.json for running CATS against current bosh target.\n    run_bridge_tests    \t\t Run Bridge unit tests\n    sits                \t\t Runs sits against a bosh lite\nworkspaces\n    capi-workspaces     \t\t List and connect to existing K8s CAPI workspaces\n    create-capi-workspace \t\t Create a CAPI workspace in K8s cluster\n```\n\n## Using the Bosh Lite Pool\n\nAs a perk, [CAPI\napprovers](https://github.com/cloudfoundry/community/blob/main/toc/working-groups/app-runtime-interfaces.md)\nget access to a pool of cf-deployment environments, deployed on bosh lites in a\nCFF-managed IaaS account. These environments are disposable, and are only\nintended for development use.\n\nThough it is technically possible to use the pool without them, there are a\nnumber of convenience scripts provided by capi-workspace that make the pool\nusable by humans.\n\n### Prerequisites\n\n- git\n- Clone capi-workspace (this repo)\n- Add capi-workspace scripts/functions to your shell (see installation instructions above (or below))\n- Clone https://github.com/cloudfoundry/capi-env-pool\n\n### Example Pool Dev Workflow\n\nClaim an environment from the pool:\n```\n❯ claim_bosh_lite\nClaiming 'distaffs'...\nWriting out .envrc...\nPushing reservation to capi-env-pool...\nUse 'target_bosh distaffs' to set bosh environment variables.\n```\n\nObserve that you successfully claimed the environment:\n```\n❯ print_env_info\nRounding up claimed environments...\n\n* ENV *      * CLAIMED BY *  * CLAIMED ON *                  * CLAIMED SINCE *\napologia     Tim Downey      tdowney.hostname                3 weeks ago\ndistaffs     Greg Cobb       gcobb.hostname                  2 minutes ago\nriskier      Greg Cobb       gcobb.hostname                  13 days ago\nzoned        Seth Boyles     capi-ws-cc-203                  3 weeks ago\n```\n\nSet bosh environment variables in your shell to \"target\" that environment:\n```\n❯ target_bosh distaffs\n\nRefreshing bosh lite pool state...\nAlready up to date.\n\nSourcing /.../capi-env-pool/bosh-lites/claimed/distaffs to set bosh environment variables...\n\nWriting a capi-specific integration_config.json...\nGenerated /.../capi-env-pool/distaffs/integration_config.json. Enjoy!\n\nWriting a bosh gateway ssh key...\nGenerated /.../capi-env-pool/distaffs/bosh.pem. Enjoy!\n\nSetting BOSH_GW_PRIVATE_KEY, BOSH_ALL_PROXY, and CONFIG environment variables...\nSuccess!\n```\n\nLog in to the environment with the `cf` CLI:\n```\n❯ target_cf\nGetting CF admin password from credhub...\nSetting API endpoint to https://api.distaffs.app-runtime-interfaces.ci.cloudfoundry.org...\nOK\n\nAPI endpoint:   https://api.distaffs.app-runtime-interfaces.ci.cloudfoundry.org\nAPI version:    3.166.0\n\nNot logged in. Use 'cf login' or 'cf login --sso' to log in.\nAPI endpoint: https://api.distaffs.app-runtime-interfaces.ci.cloudfoundry.org\n\nAuthenticating...\nOK\n\nUse 'cf target' to view or set your target org and space.\n```\n\nCreate a default Organization and Space:\n```\n❯ bootstrap_cf\nGetting CF admin password from credhub...\nSetting API endpoint to https://api.distaffs.app-runtime-interfaces.ci.cloudfoundry.org...\nOK\n\nAPI endpoint:   https://api.distaffs.app-runtime-interfaces.ci.cloudfoundry.org\nAPI version:    3.166.0\n\nNot logged in. Use 'cf login' or 'cf login --sso' to log in.\nAPI endpoint: https://api.distaffs.app-runtime-interfaces.ci.cloudfoundry.org\n\nAuthenticating...\nOK\n\nUse 'cf target' to view or set your target org and space.\nCreating org org as admin...\nOK\n\nTIP: Use 'cf target -o \"org\"' to target new org\nAPI endpoint:   https://api.distaffs.app-runtime-interfaces.ci.cloudfoundry.org\nAPI version:    3.166.0\nuser:           admin\norg:            org\nNo space targeted, use 'cf target -s SPACE'\nCreating space space in org org as admin...\nOK\n\nAssigning role SpaceManager to user admin in org org / space space as admin...\nOK\n\nAssigning role SpaceDeveloper to user admin in org org / space space as admin...\nOK\n\nTIP: Use 'cf target -o \"org\" -s \"space\"' to target new space\nAPI endpoint:   https://api.distaffs.app-runtime-interfaces.ci.cloudfoundry.org\nAPI version:    3.166.0\nuser:           admin\norg:            org\nspace:          space\n```\n\nDeploy the cf-deployment and capi-release versions from your dev machine:\n```\n❯ deploy\nUploading new release to 35.185.252.196.\n\nSyncing bosh blobs...\nbosh sync-blobs\n...\n\nCreating bosh release...\ncreate-release --force --name capi\n...\n\nUploading release to bosh director...\nbosh upload-release --rebase\n...\n\nDeploying uploaded release...\nbosh deploy cf-deployment.yml -o...\n...\nSucceeded\n```\n\nMake local changes and deploy a new CAPI version:\n```\n❯ deploy_only_new_capi\nBuilding a new CAPI from local filesystem and deploying to 35.185.252.196.\nbosh deploy \u003c(bosh manifest) -o ...use-created-capi.yml ...\n...\nSucceeded\n```\n\nRelease the environment for deletion, once you are done with it:\n```\n❯ unclaim_bosh_lite riskier\nRefreshing bosh lite pool state...\nHit enter to release 'riskier'\nrm 'riskier/.envrc'\nPushing the release commit to capi-env-pool...\nDone!\n```\n\n## Automated Workstation Setup\n\nIf you want, there are also some opinionated scripts you can run to set up a\nnew computer for CAPI development. These may be useful if you are dynamically\nprovisioning remote workstations, or something like that.\n\n### Dependencies\n* MacOS\n* pip\n\n### Running the Installer\n\n```\n    mkdir -p ~/workspace \u0026\u0026 cd ~/workspace\n    git clone git@github.com:cloudfoundry/capi-workspace.git \u0026\u0026 cd capi-workspace\n```\n\nYou can now either install via `./install.sh` or `./install-core.sh`.\n\nOr curl the bootstrap script, which will create the `workspace` directory and clone this repo for you.\nThis is primarily intended for quickly setting up virtual workstations.\n\n```\nbash \u003c(curl -s https://raw.githubusercontent.com/cloudfoundry/capi-workspace/main/bootstrap.sh)\n```\n\n## Manual steps (to be automated later)\n* Open System Preferences / Users \u0026 Groups / \u003cuser\u003e / Login Items\n    * Add `flycut` from Applications\n    * Add `spectacle` from Applications\n* Log out/Log in\n    * This will cause Flycut and Spectacle to run and ask for permissions\n* Open up Rubymine manually and enter a `License Server`\n* Install the `mine` cli shortcut (RubyMine -\u003e Tools -\u003e Create Command-line Launcher...)\n* If you are using Goland do the same two previous steps for Goland\n* If you have access to the private CAPI backlog, add a secure note called `tracker_api_token` to LastPass with your Pivotal Tracker API token. This token will be used in scripts such as `claim_bosh_lite` to pull story titles currently in flight.\n\n## Contributing to this repo\n\n* kindly consider when a change is worth making to `install-core.sh` versus `install.sh`.\n* [bash-it](https://github.com/Bash-it/bash-it) We use bash-it to organize and streamline our bash settings. This includes stuff like color schemes, aliases, shell settings, and the shell prompt formatting. Adding \"plugins\" to `custom-bash-it-plugins` will cause them to be installed in every new shell.\n\n## What this installation does\n\n`install-core.sh`: intended to be more friendly for developers who don't want this repository to take over their machine. This is intended to be the minimal set of things required for working with a CAPI repository.\n* Only installs core utilities, languages, services, and binaries.\n* Is NOT responsible for installing \u0026 configuring any editors (nvim/vscode/intellij)\n* Is NOT responsible for installing tools for improving developer workflows (jq/rg)\n* Is NOT responsible for applying any git configuration\n* Is NOT responsible for loading in scripts that need to be `source`'d.\n* Is NOT responsible for modifying your `$PATH` to include `script`\n\n`./install.sh`: runs `install-core.sh` and configures the machine with many more packages/preferences\n\n## install.sh or install-core.sh ?\n\n`install-core.sh` is a subset of `install.sh` and is intended to be less invasive to the machine, without compromising on provisioning a workstation suitable to working on CAPI projects.\n\nFor fresh workstations \u0026\u0026 full-time CAPI developers, install.sh might make more sense.\n\nFor folks working on multiple projects, `install-core.sh` might make more sense.\n\nFor folks with existing workstations \u0026 configuration, `install-core.sh` might make more sense.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudfoundry%2Fcapi-workspace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudfoundry%2Fcapi-workspace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudfoundry%2Fcapi-workspace/lists"}