{"id":15702541,"url":"https://github.com/rosenbjerg/agentdeploy","last_synced_at":"2025-05-12T15:36:44.322Z","repository":{"id":37828726,"uuid":"342725866","full_name":"rosenbjerg/agentdeploy","owner":"rosenbjerg","description":"An agent for managing execution of taco bell style deployment and server management scripts","archived":false,"fork":false,"pushed_at":"2023-02-22T04:17:22.000Z","size":700,"stargazers_count":6,"open_issues_count":10,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-05-05T15:06:50.213Z","etag":null,"topics":["automation","bash","cli-tool","deployment","remote","rest-api","scripts","ssh"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rosenbjerg.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-26T23:23:48.000Z","updated_at":"2024-08-13T15:07:23.000Z","dependencies_parsed_at":"2024-10-24T06:11:15.319Z","dependency_job_id":"842d46df-b5db-41b1-ad3a-6e44468f016b","html_url":"https://github.com/rosenbjerg/agentdeploy","commit_stats":{"total_commits":330,"total_committers":2,"mean_commits":165.0,"dds":0.09999999999999998,"last_synced_commit":"faf27ddb3e7c0ba468b21c456e1611f5de498048"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosenbjerg%2Fagentdeploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosenbjerg%2Fagentdeploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosenbjerg%2Fagentdeploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosenbjerg%2Fagentdeploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rosenbjerg","download_url":"https://codeload.github.com/rosenbjerg/agentdeploy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253766635,"owners_count":21960956,"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","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":["automation","bash","cli-tool","deployment","remote","rest-api","scripts","ssh"],"created_at":"2024-10-03T20:01:21.086Z","updated_at":"2025-05-12T15:36:44.287Z","avatar_url":"https://github.com/rosenbjerg.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# agentd\n\nAn agent for managing execution of [taco bell programming](http://widgetsandshit.com/teddziuba/2010/10/taco-bell-programming.html)-style deployment and server management scripts on remote hosts\n\n[![CI](https://github.com/rosenbjerg/AgentDeploy/actions/workflows/ci.yml/badge.svg)](https://github.com/rosenbjerg/agentdeploy/actions/workflows/ci.yml)\n[![GitHub](https://img.shields.io/github/license/rosenbjerg/agentdeploy)](https://github.com/rosenbjerg/agentdeploy/blob/main/LICENSE)\n[![codecov.io](https://codecov.io/github/rosenbjerg/agentdeploy/coverage.svg?branch=main)](https://app.codecov.io/gh/rosenbjerg/agentdeploy)\n\n[![Server Docker Pulls](https://img.shields.io/docker/pulls/mrosenbjerg/agentd-server?label=server%20docker%20pulls)](https://hub.docker.com/r/mrosenbjerg/agentd-server)\n[![Server version](https://img.shields.io/docker/v/mrosenbjerg/agentd-server?sort=semver)](https://hub.docker.com/r/mrosenbjerg/agentd-server)\n[![Server Docker Image size](https://img.shields.io/docker/image-size/mrosenbjerg/agentd-server?sort=semver)](https://hub.docker.com/r/mrosenbjerg/agentd-server)\n\n[![Client Docker Pulls](https://img.shields.io/docker/pulls/mrosenbjerg/agentd-client?label=client%20docker%20pulls)](https://hub.docker.com/r/mrosenbjerg/agentd-client)\n[![Client version](https://img.shields.io/docker/v/mrosenbjerg/agentd-client?sort=semver)](https://hub.docker.com/r/mrosenbjerg/agentd-client)\n[![Client Docker Image size](https://img.shields.io/docker/image-size/mrosenbjerg/agentd-client?sort=semver)](https://hub.docker.com/r/mrosenbjerg/agentd-client)\n\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=rosenbjerg_AgentDeploy\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=rosenbjerg_AgentDeploy)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=rosenbjerg_AgentDeploy\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=rosenbjerg_AgentDeploy)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=rosenbjerg_AgentDeploy\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=rosenbjerg_AgentDeploy)\n[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=rosenbjerg_AgentDeploy\u0026metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=rosenbjerg_AgentDeploy)\n[![CodeFactor](https://www.codefactor.io/repository/github/rosenbjerg/agentdeploy/badge/main)](https://www.codefactor.io/repository/github/rosenbjerg/agentdeploy/overview/main)\n\n\n## Server\nRunning the `agentd` server, either in a container or directly using an executable, exposes a REST endpoint that can be used to invoke **scripts**. These **scripts** are either executed locally relative to the executable, or remotely through SSH.\n\n**Scripts** are defined using yaml files that specify which *variables* the **script** require for invocation. Both *variables*, *secret variables* and *files* are declared and optionally constrained to certain values using regular expressions. *Files* can be constrained on size (maximum and minimum) and file extension.\n\nPermission to invoke a **script** is granted through a **token**, which is also specified by a yaml file. A **token** can also limit which of the availabe **script**-files should be invocable with a given **token**.\n\n**Tokens** can also further constrain the input *variables* to a given **script** or even lock a *variable* to a specific value.\n\n### Script examples\n\n#### Minimal example (`minimal-example.yaml`)\n```yaml\nvariables:\n  name:\ncommand: echo \"Hello $(name)!\"\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eAdvanced example (\u003ccode\u003eadvanced-example.yaml\u003c/code\u003e)\u003c/summary\u003e\n \n```yaml\nvariables:\n  username:\n    default_value: johndoe\n  password:\n    secret: true\n    regex: ^s{16,32}$\nfiles:\n  test_file:\n    max_size: 1_000\n    preprocessing: clamscan -i $(FilePath)\nassets:\n  - *.jpeg\n  - resize.sh\nshow_command: true\nconcurrency: none\ncommand: |\n  echo \"logging in $(username):$(password)\"\n  cat $(test_file)\n  bash ./resize.sh ./*.jpeg /home/someuser/images\n```\n\u003c/details\u003e\n\n\n### Token examples\n#### Minimal example (`my-token-123.yaml`)\n```yaml\navailable_scripts:\n  minimal-example:\n  advanced-example:\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eAdvanced example (\u003ccode\u003eadv-token-321.yaml\u003c/code\u003e)\u003c/summary\u003e\n \n```yaml\nname: advanced example\ndescription: just an advanced example with more stuff in it\nssh:\n  username: myuser\n  private_key_file: /home/myuser/.ssh/id_rsa\ntrusted_ips:\n  - 127.0.0.1\n  - ::1\n  - ::ffff:172.18.0.1\navailable_scripts:\n  minimal-example:\n    variable_constraints: \n      name: ^john(doe)?$\n  advanced-example:\n    ssh:\n      username: myotheruser\n      private_key_file: /home/myotheruser/.ssh/id_rsa\n    locked_variables:\n      username: john\n    variable_constraints:\n      password: ^[a-zA-Z0-9_-]{18,32}$\n```\n\u003c/details\u003e\n\n\n## Client\nThe `agentd-client` CLI tool simplifies usage in terminals, scripts and CD pipelines by providing a simple way to invoke the `agentd` server. \nThe CLI tool supports WebSockets to enable the output from the invoked script to be printed immediately after it is emitted.\n\n#### Installation\nDownload a binary from [GitHub Releases](https://github.com/rosenbjerg/agentdeploy/releases) or use with docker using an alias `alias agentd-client='docker run --rm -it -v $(pwd):/files mrosenbjerg/agentd-client'`\n\n#### Minimal usage example\n```\nagentd-client invoke minimal-example http://localhost:5000 -i -v name=John\n// or\nagentd-client invoke minimal-example http://localhost:5000 -t my-token-123 -v name=John\n```\n\n#### Advanced usage example\n```\nagentd-client invoke advanced-example http://localhost:5000 -iw -v username=johndoe password=longbutveryweakpassword -f test_file=./the-test-file.txt\n// or\nagentd-client invoke advanced-example http://localhost:5000 -w -t adv-token-321 -v username=johndoe password=longbutveryweakpassword -f test_file=./the-test-file.txt\n```\n\n#### Help\nUse `--help` to print the CLI help.\nFor version 3.x:  \n```\nUsage: agentd-client [options] [command]\n\nOptions:\n  -V, --version                                  output the version number\n  -t, --token \u003ctoken\u003e                            Authentication token\n  -i, --interactive                              Enable providing token through stdin\n  -w, --ws                                       Enable websocket connection for receiving output\n  -v, --variables \u003ckeyValuePair...\u003e              Add variable\n  -s, --secret-variables \u003ckeyValuePair...\u003e       Add secret variable\n  -e, --environment-variables \u003ckeyValuePair...\u003e  Add environment variable\n  -f, --files \u003ckeyValuePair...\u003e                  Add file\n  --hide-timestamps                              Omit printing timestamps\n  --hide-headers                                 Omit printing info headers\n  --hide-script                                  Omit printing script (if available)\n  --hide-script-line-numbers                     Omit printing line-numbers for script\n  -h, --help                                     display help for command\n\nCommands:\n  invoke \u003cscriptName\u003e \u003cserverUrl\u003e                Invoke named script on remote server\n  help [command]                                 display help for command\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frosenbjerg%2Fagentdeploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frosenbjerg%2Fagentdeploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frosenbjerg%2Fagentdeploy/lists"}