{"id":15383809,"url":"https://github.com/jamessimone/sf-trace-plugin","last_synced_at":"2025-08-01T10:05:03.149Z","repository":{"id":228277970,"uuid":"769208694","full_name":"jamessimone/sf-trace-plugin","owner":"jamessimone","description":"SF CLI plugin to allow trace flags to be set for you, users, and the Automated Process User","archived":false,"fork":false,"pushed_at":"2025-01-13T20:49:01.000Z","size":510,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-29T00:13:02.110Z","etag":null,"topics":["cli","plugin","salesforce","sf-cli","sfdx-cli"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/jamessimone.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}},"created_at":"2024-03-08T15:08:40.000Z","updated_at":"2025-03-18T03:18:39.000Z","dependencies_parsed_at":"2024-03-26T21:28:50.771Z","dependency_job_id":"d7b23f22-11c1-4279-bfa6-85aa1aade5e1","html_url":"https://github.com/jamessimone/sf-trace-plugin","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"f51f45e353395e5099200657625e286f6d0b1bbd"},"previous_names":["jamessimone/sf-trace-plugin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamessimone%2Fsf-trace-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamessimone%2Fsf-trace-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamessimone%2Fsf-trace-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamessimone%2Fsf-trace-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamessimone","download_url":"https://codeload.github.com/jamessimone/sf-trace-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249139984,"owners_count":21219212,"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":["cli","plugin","salesforce","sf-cli","sfdx-cli"],"created_at":"2024-10-01T14:39:42.613Z","updated_at":"2025-04-15T19:39:04.949Z","avatar_url":"https://github.com/jamessimone.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SF Apex Trace Plugin\n\nThis plugin was developed for the Joys Of Apex post [Authoring SF CLI Plugins](https://jamessimone.net/blog/joys-of-apex/authoring-sf-cli-plugins/), and it allows you to setup and maintain `TraceFlag` records for any Salesforce org you're authorized to using the SF CLI.\n\n## Installation\n\nIt can be installed by running:\n\n```bash\necho y | sf plugins install jamessimone/sf-trace-plugin\n```\n\nOr by adding `sf-trace-plugin` to your [unsignedPluginAllowlist.json](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_allowlist.htm):\n\n```json\n[\"jamessimone/sf-trace-plugin\"]\n```\n\nAnd then running:\n\n```bash\nsf plugins install jamessimone/sf-trace-plugin\n```\n\nOr by pointing to the GitHub repository itself during the install command:\n\n```bash\nsf plugins install https://github.com/jamessimone/sf-trace-plugin\n```\n\n## Usage\n\nBy default, you can run the plugin without arguments to start a one hour trace for your user in your currently authenticated org:\n\n```bash\nsf apex trace\n```\n\nDifferent command line flags allow you to augment this functionality, stipulating a minute or hour time frame:\n\n```bash\n# sets a 30 minute trace on the Automated Process User\nsf apex trace --trace-duration 30m --is-autoproc-trace\n# sets a 2 hour trace on another user\nsf apex trace --trace-duration 2hr --target-user someOtherUser@salesforce.com\n```\n\nThe API for the allowable flags is delineated below.\n\n### Command Line Flags\n\nThis plugin currently supports the following flags:\n\n- `--debug-level-name` (shortcut `-l`): if there has never been a `USER_DEBUG` TraceFlag record for the given user, this optional flag stipulates the `DebugLevel` DeveloperName to use. Defaults to `SFDC_DevConsole`, otherwise.\n- `--is-autoproc-trace` (shortcut `-a`): if the trace should be set for the Automated Process User. Cannot be used in conjunction with `--target-user`\n- `--trace-duration` (shortcut `-d`): how long you'd like the trace to be active for. Defaults to `1hr` and values can be supplied with either minutes (eg `15m`) or hours (eg `4hr`). Because `TraceFlag` records can have a max duration of 24 hours, inputting a trace duration of more than that will only set the duration for 24 hours.\n- `--target-org` (shortcut `-o`): the name/alias of the org you want to establish the trace on. Defaults to your currently authorized org when run in an SFDX project directory\n- `--target-user` (shortcut `-u`): by default, traces are set for the currently authorized user; this flag allows you to override that and supply any valid username in the org to set a trace for. Cannot be used in conjunction with `--is-autoproc-trace`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamessimone%2Fsf-trace-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamessimone%2Fsf-trace-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamessimone%2Fsf-trace-plugin/lists"}