{"id":28961744,"url":"https://github.com/getappmap/appland-cli","last_synced_at":"2025-06-24T02:04:51.825Z","repository":{"id":53756726,"uuid":"258025042","full_name":"getappmap/appland-cli","owner":"getappmap","description":"Command line interface for https://app.land","archived":false,"fork":false,"pushed_at":"2021-03-15T22:29:57.000Z","size":132,"stargazers_count":9,"open_issues_count":2,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-24T09:55:18.386Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/getappmap.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-22T21:34:12.000Z","updated_at":"2024-04-24T09:55:18.388Z","dependencies_parsed_at":"2022-09-26T20:41:29.647Z","dependency_job_id":null,"html_url":"https://github.com/getappmap/appland-cli","commit_stats":null,"previous_names":["applandinc/appland-cli"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/getappmap/appland-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getappmap%2Fappland-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getappmap%2Fappland-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getappmap%2Fappland-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getappmap%2Fappland-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getappmap","download_url":"https://codeload.github.com/getappmap/appland-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getappmap%2Fappland-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261589912,"owners_count":23181437,"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":[],"created_at":"2025-06-24T02:04:51.162Z","updated_at":"2025-06-24T02:04:51.803Z","avatar_url":"https://github.com/getappmap.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# appland-cli\n\n## Usage\n### Quickstart\n```\n$ appland login\nlogging into https://app.land\n\nlogin: username\npassword:\n\nlogged in.\n\n$ appland stats tmp/appmap/minitest\n11655 calls, top 20 methods\n  Digest::Instance#digest: 3864 (40 distinct)\n  IO#write: 1926 (697 distinct)\n  Logger#add: 1846 (249 distinct)\n  IO#read: 1558 (7 distinct)\n  IO#close: 625 (1 distinct)\n  SessionsHelper#current_user: 404 (1 distinct)\n  UsersHelper#gravatar_for: 231 (172 distinct)\n  SessionsHelper#current_user?: 194 (133 distinct)\n  JSON::Ext::Generator::State#generate: 188 (87 distinct)\n  OpenSSL::Cipher#final: 136 (1 distinct)\n  JSON::Ext::Parser#parse: 122 (1 distinct)\n  OpenSSL::Cipher#encrypt: 92 (1 distinct)\n  SessionsHelper#logged_in?: 82 (1 distinct)\n  User.digest: 58 (25 distinct)\n  OpenSSL::Cipher#decrypt: 44 (1 distinct)\n  User#feed: 43 (1 distinct)\n  ApplicationHelper#full_title: 34 (15 distinct)\n  User.new_token: 26 (1 distinct)\n  SessionsHelper#log_in: 22 (22 distinct)\n  SessionsController#create: 21 (1 distinct\n$ appland upload tmp/appmap/minitest/\n 100% |████████████████████████████████████████|  [3s:0s]\n\nSuccess! rails_sample_app_6th_ed has been updated with 67 scenarios.\n```\n\n### Running in CI/CD\nConfigure your CI/CD tool to provide the following environment variables at\nruntime. By providing these environment variables, `appland` can authenticate\nwithout any persistent configuration.\n- `APPLAND_API_KEY`: Generate a new API key from your [account page](https://app.land/user) to populate this value.\n- `APPLAND_URL`: Typically this will be set to `https://app.land`\n\n\n### Commands\n#### authentication\nAuthentication and API key management.\n\n`appland login`\nThis will prompt you for a login and password. Your password will not be echoed.\n\n`appland logout`\nLogs the current user out of AppLand and revokes the API key in use.\n\n#### contexts\nAppLand has the ability to support a number of configuration contexts. In most\ncases, you won't need additional contexts. Upon first run, a `default` context\nis created, pointing to [app.land](https://app.land). Subcommands which issue\nAPI calls to an AppLand service (such as `login` and `upload`) will use this\ncontext for configuration options and authentication.\n\n`context add [name] [url]`\nCreate a new context.\n\n`context current`\nDisplay the current context.\n\n`context list`\nShow all available contexts.\n\n`context use [name]`\nSelect a context as the current context. This is set to a default context upon\nfirst run.\n\n#### upload\nCreate a mapset of scenarios by uploading AppMap files.\n\n`upload [files, dirs]`\nUploads a list of AppMap files or directories to AppLand.\n\n#### stats\nShow some statistics about events in scenarios read from AppMap files.\n\n`stats [files, dirs]`\n\n## Displaying statistics\nThe `stats` subcommand will show some simple statistics about events in a collection of\nAppMaps:\n\n```\n$ appland stats --help\nShow statistics for AppMaps\n\nUsage:\n  appland stats [flags]\n\nFlags:\n  -f, --files       show statistics for each file\n  -h, --help        help for stats\n  -j, --json        format results as JSON\n  -l, --limit int   limit the number of methods displayed (default 20)\n  -p, --params      show distinct parameters for each method\n  -v, --verbose     be verbose while processing\n```\n\nThe `stats` subcommand is also useful for [refining the recordings in\nAppMaps](doc/refine-appmaps.md).\n\n### Some examples\n#### With defaults\nShow the top 20 methods. For each method, the total number of call events are shown, as\nwell as the number of distinct calls (i.e. with different parameters).\n\n```\n$ appland stats Application_page_with_a_mapset_restores_the_tab_from_location_hash.appmap.json\n229 calls, top 20 methods\n  JSON::Ext::Parser#parse: 38 (1 distinct)\n  Net::HTTP#request: 32 (8 distinct)\n  JSON::Ext::Generator::State#generate: 30 (13 distinct)\n  ClassMap::CodeObjectName.parse: 7 (7 distinct)\n  Mapset::Show#web_resources: 7 (1 distinct)\n  Mapset::Show#data_model: 6 (1 distinct)\n  OpenSSL::Cipher#final: 6 (1 distinct)\n  WebResources.dehydrate: 5 (2 distinct)\n  Configuration#attributes: 4 (1 distinct)\n  DataModel.dehydrate: 4 (1 distinct)\n  Mapset::Show#recording_method_counts: 4 (1 distinct)\n  Search#filter: 4 (2 distinct)\n  App::Show#mapsets: 3 (1 distinct)\n  Configuration#attributes=: 3 (1 distinct)\n  Configuration.find: 3 (3 distinct)\n  KeyDataStats.count: 3 (3 distinct)\n  OpenSSL::Cipher#decrypt: 3 (1 distinct)\n  OpenSSL::Cipher#encrypt: 3 (1 distinct)\n  Scenario::SearchActions.search: 3 (3 distinct)\n  User.find_by_id!: 3 (1 distinct)\n```\n\n#### Statistics for individual files\nWith `--files`, show statistics for individual files. Adding `--params` will include the\ndistinct parameters for each method.\n\n```\n$ appland stats --files --params Application_page_with_a_mapset_restores_the_tab_from_location_hash.appmap.json\nApplication_page_with_a_mapset_restores_the_tab_from_location_hash.appmap.json: 229 calls, top 20 methods\n  JSON::Ext::Parser#parse: 38 (1 distinct)\n   no parameters\n  Net::HTTP#request: 32 (8 distinct)\n   has parameters\n    Net::HTTP::Post[POST /session/c300eeef64aa2b0dcd284b14cfeca788/elements],\u003cnil\u003e,\u003cnil\u003e\n    Net::HTTP::Post[POST /session/c300eeef64aa2b0dcd284b14cfeca788/execute/sync],\u003cnil\u003e\n    Net::HTTP::Post[POST /session/c300eeef64aa2b0dcd284b14cfeca788/execute/sync],\u003cnil\u003e,\u003cnil\u003e\n    Net::HTTP::Get[GET /session/c300eeef64aa2b0dcd284b14cfeca788/element/95946e42-80a6-46a3-ac3b-e3a8c20,\u003cnil\u003e\n    Net::HTTP::Get[GET /session/c300eeef64aa2b0dcd284b14cfeca788/element/95946e42-80a6-46a3-ac3b-e3a8c20,\u003cnil\u003e,\u003cnil\u003e\n    Net::HTTP::Post[POST /session/c300eeef64aa2b0dcd284b14cfeca788/url],\u003cnil\u003e\n    Net::HTTP::Post[POST /session/c300eeef64aa2b0dcd284b14cfeca788/url],\u003cnil\u003e,\u003cnil\u003e\n    Net::HTTP::Post[POST /session/c300eeef64aa2b0dcd284b14cfeca788/elements],\u003cnil\u003e\n  JSON::Ext::Generator::State#generate: 30 (13 distinct)\n   has parameters\n    [{\"name\"=\u003e\"controllers\", \"type\"=\u003e\"package\", \"children\"=\u003e[{\"name\"=\u003e\"SessionController\", \"type\"=\u003e\"clas\n    {\"HTTP server requests\"=\u003e1, \"SQL queries\"=\u003e1, \"Messages\"=\u003e1}\n    {:using=\u003e\"css selector\", :value=\u003e\"#datamodel.active.show\"}\n    {:script=\u003e\"return ((function(){function d(t,e,n){function r(t){var e=x(t);if(0\u003ce.height\u0026\u00260\u003ce.width)r\n    {:using=\u003e\"css selector\", :value=\u003e\".tab-content .show\"}\n    {\"session_id\"=\u003e\"d142aeeff345540b576465126fb2d26c\", \"user_id\"=\u003e1, \"configuration\"=\u003e\"{}\", \"flash\"=\u003e{\"d\n    {\"tables\"=\u003e[\"users\"], \"joins\"=\u003e[]}\n    {\"resource_map\"=\u003e{\"sessions\"=\u003e[{\"path\"=\u003e\"/sessions/new\", \"methods\"=\u003e{\"POST\"=\u003e[{\"event_id\"=\u003e1, \"scena\n    {\"packages\"=\u003e[\"HTTP\", \"SQL\"], \"class_package\"=\u003e{\"POST /sessions/new\"=\u003e\"HTTP\", \"SQL\"=\u003e\"SQL\"}, \"packag\n    {\"element-6066-11e4-a52e-4f735466cecf\"=\u003e\"95946e42-80a6-46a3-ac3b-e3a8c2058a82\"}\n    {:url=\u003e\"http://127.0.0.1:49651/applications/1#datamodel\"}\n    [{\"owner_type\"=\u003e\"mapset\", \"owner_id\"=\u003e1, \"recording_method\"=\u003e\"rspec\", \"num_scenarios\"=\u003e1}]\n...\n```\n\n#### JSON output\nThe output can also be formatted as JSON. The elements of the array are sorted by the\nnumber of calls.\n```\n$ appland stats --json --files --params Application_page_with_a_mapset_restores_the_tab_from_location_hash.appmap.json\nApplication_page_with_a_mapset_restores_the_tab_from_location_hash.appmap.json: [\n  {\n    \"method\": \"JSON::Ext::Parser#parse\",\n    \"calls\": 38,\n    \"num_params\": 0,\n    \"param_counts\": {\n      \"\": 38\n    }\n  },\n  {\n    \"method\": \"Net::HTTP#request\",\n    \"calls\": 32,\n    \"num_params\": 2,\n    \"param_counts\": {\n      \"Net::HTTP::Get[GET /session/c300eeef64aa2b0dcd284b14cfeca788/element/95946e42-80a6-46a3-ac3b-e3a8c20,\\u003cnil\\u003e\": 1,\n      \"Net::HTTP::Get[GET /session/c300eeef64aa2b0dcd284b14cfeca788/element/95946e42-80a6-46a3-ac3b-e3a8c20,\\u003cnil\\u003e,\\u003cnil\\u003e\": 1,\n      \"Net::HTTP::Post[POST /session/c300eeef64aa2b0dcd284b14cfeca788/elements],\\u003cnil\\u003e\": 11,\n      \"Net::HTTP::Post[POST /session/c300eeef64aa2b0dcd284b14cfeca788/elements],\\u003cnil\\u003e,\\u003cnil\\u003e\": 11,\n      \"Net::HTTP::Post[POST /session/c300eeef64aa2b0dcd284b14cfeca788/execute/sync],\\u003cnil\\u003e\": 3,\n      \"Net::HTTP::Post[POST /session/c300eeef64aa2b0dcd284b14cfeca788/execute/sync],\\u003cnil\\u003e,\\u003cnil\\u003e\": 3,\n      \"Net::HTTP::Post[POST /session/c300eeef64aa2b0dcd284b14cfeca788/url],\\u003cnil\\u003e\": 1,\n      \"Net::HTTP::Post[POST /session/c300eeef64aa2b0dcd284b14cfeca788/url],\\u003cnil\\u003e,\\u003cnil\\u003e\": 1\n    }\n  },\n  {\n    \"method\": \"JSON::Ext::Generator::State#generate\",\n    \"calls\": 30,\n    \"num_params\": 1,\n    \"param_counts\": {\n      \"[{\\\"name\\\"=\\u003e\\\"controllers\\\", \\\"type\\\"=\\u003e\\\"package\\\", \\\"children\\\"=\\u003e[{\\\"name\\\"=\\u003e\\\"SessionController\\\", \\\"type\\\"=\\u003e\\\"clas\": 2,\n      \"[{\\\"owner_type\\\"=\\u003e\\\"mapset\\\", \\\"owner_id\\\"=\\u003e1, \\\"recording_method\\\"=\\u003e\\\"rspec\\\", \\\"num_scenarios\\\"=\\u003e1}]\": 1,\n      \"{\\\"HTTP server requests\\\"=\\u003e1, \\\"SQL queries\\\"=\\u003e1, \\\"Messages\\\"=\\u003e1}\": 1,\n      \"{\\\"element-6066-11e4-a52e-4f735466cecf\\\"=\\u003e\\\"95946e42-80a6-46a3-ac3b-e3a8c2058a82\\\"}\": 3,\n      \"{\\\"package\\\"=\\u003e2, \\\"class\\\"=\\u003e2, \\\"function\\\"=\\u003e3}\": 1,\n      \"{\\\"packages\\\"=\\u003e[\\\"HTTP\\\", \\\"SQL\\\"], \\\"class_package\\\"=\\u003e{\\\"POST /sessions/new\\\"=\\u003e\\\"HTTP\\\", \\\"SQL\\\"=\\u003e\\\"SQL\\\"}, \\\"packag\": 1,\n      \"{\\\"resource_map\\\"=\\u003e{\\\"sessions\\\"=\\u003e[{\\\"path\\\"=\\u003e\\\"/sessions/new\\\", \\\"methods\\\"=\\u003e{\\\"POST\\\"=\\u003e[{\\\"event_id\\\"=\\u003e1, \\\"scena\": 1,\n      \"{\\\"session_id\\\"=\\u003e\\\"d142aeeff345540b576465126fb2d26c\\\", \\\"user_id\\\"=\\u003e1, \\\"configuration\\\"=\\u003e\\\"{}\\\", \\\"flash\\\"=\\u003e{\\\"d\": 3,\n      \"{\\\"tables\\\"=\\u003e[\\\"users\\\"], \\\"joins\\\"=\\u003e[]}\": 2,\n      \"{:script=\\u003e\\\"return ((function(){function d(t,e,n){function r(t){var e=x(t);if(0\\u003ce.height\\u0026\\u00260\\u003ce.width)r\": 3,\n      \"{:url=\\u003e\\\"http://127.0.0.1:49651/applications/1#datamodel\\\"}\": 1,\n...\n```\n\n## Development\n[![Build Status](https://travis-ci.com/applandinc/appland.svg?token=oNqy5hPadVE4PUAF9ZWk\u0026branch=master)](https://travis-ci.com/applandinc/appland)\n\n### Building\n`./bin/build` will build a binary to the `dist` directory. To install, copy the\nbinary to `/usr/local/bin`.\n\n### Testing\n`go test -v ./...` will run all tests. API calls are mocked and do not require a\nlive AppLand service.\n\n## Releases\nReleases are automatically published upon creation of a new tag.\nExample:\n```bash\n$ git tag -a $(cat VERSION) -m \"Version $(cat VERSION)\"\n$ git push origin \"$(cat VERSION)\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetappmap%2Fappland-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetappmap%2Fappland-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetappmap%2Fappland-cli/lists"}