{"id":15896196,"url":"https://github.com/numberoverzero/trudge-cli","last_synced_at":"2025-04-02T18:25:57.489Z","repository":{"id":142804121,"uuid":"349253852","full_name":"numberoverzero/trudge-cli","owner":"numberoverzero","description":null,"archived":false,"fork":false,"pushed_at":"2021-03-21T08:06:51.000Z","size":449,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-08T09:12:17.846Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/numberoverzero.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}},"created_at":"2021-03-19T00:22:37.000Z","updated_at":"2021-03-21T08:05:29.000Z","dependencies_parsed_at":"2023-05-25T05:15:47.954Z","dependency_job_id":null,"html_url":"https://github.com/numberoverzero/trudge-cli","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numberoverzero%2Ftrudge-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numberoverzero%2Ftrudge-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numberoverzero%2Ftrudge-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numberoverzero%2Ftrudge-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numberoverzero","download_url":"https://codeload.github.com/numberoverzero/trudge-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246867739,"owners_count":20846804,"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":"2024-10-06T09:06:48.184Z","updated_at":"2025-04-02T18:25:57.472Z","avatar_url":"https://github.com/numberoverzero.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"trudge-cli\n==========\n\nsqlite migration tool\n\n[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)\n[![Version](https://img.shields.io/npm/v/trudge-cli.svg)](https://npmjs.org/package/trudge-cli)\n[![Downloads/week](https://img.shields.io/npm/dw/trudge-cli.svg)](https://npmjs.org/package/trudge-cli)\n[![License](https://img.shields.io/npm/l/trudge-cli.svg)](https://github.com/numberoverzero/trudge-cli/blob/master/package.json)\n\n\u003c!-- toc --\u003e\n* [Usage](#usage)\n* [Commands](#commands)\n\u003c!-- tocstop --\u003e\n# Usage\n\u003c!-- usage --\u003e\n```sh-session\n$ npm install -g trudge-cli\n$ trudge COMMAND\nrunning command...\n$ trudge (-v|--version|version)\ntrudge-cli/1.0.0 linux-x64 node-v15.11.0\n$ trudge --help [COMMAND]\nUSAGE\n  $ trudge COMMAND\n...\n```\n\u003c!-- usagestop --\u003e\n# Commands\n\u003c!-- commands --\u003e\n* [`trudge downgrade DATABASEFILE MIGRATIONFILE`](#trudge-downgrade-databasefile-migrationfile)\n* [`trudge help [COMMAND]`](#trudge-help-command)\n* [`trudge new FILE`](#trudge-new-file)\n* [`trudge sync DATABASEFILE [MIGRATIONSDIR]`](#trudge-sync-databasefile-migrationsdir)\n* [`trudge upgrade DATABASEFILE MIGRATIONFILE`](#trudge-upgrade-databasefile-migrationfile)\n\n## `trudge downgrade DATABASEFILE MIGRATIONFILE`\n\napply a downgrade to the database\n\n```\nUSAGE\n  $ trudge downgrade DATABASEFILE MIGRATIONFILE\n\nARGUMENTS\n  DATABASEFILE   sqlite database file\n  MIGRATIONFILE  the migration to apply\n\nOPTIONS\n  -f, --force        force the migration to apply regardless of database state\n  -h, --help         show CLI help\n  -t, --table=table  [default: trudge_migrations] table name that tracks migration state\n  -v, --verbose      write verbose database to stdout\n  --log=log          file to write verbose database log\n\nALIASES\n  $ trudge down\n\nEXAMPLES\n  $ trudge downgrade my.db migrations/01.hello_world.sql\n  downgrade:1.hello_world.sql (a86c88c86fd3a2c0245e96294538b5c7b766697f)\n  $ trudge downgrade my.db migrations/01.hello_world.sql\n  up to date\n  $ trudge down my.db migrations/01.hello_world.sql -f\n  downgrade:1.hello_world.sql (a86c88c86fd3a2c0245e96294538b5c7b766697f)\n```\n\n_See code: [src/commands/downgrade.ts](https://github.com/numberoverzero/trudge-cli/blob/v1.0.0/src/commands/downgrade.ts)_\n\n## `trudge help [COMMAND]`\n\ndisplay help for trudge\n\n```\nUSAGE\n  $ trudge help [COMMAND]\n\nARGUMENTS\n  COMMAND  command to show help for\n\nOPTIONS\n  --all  see all commands in CLI\n```\n\n_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.2/src/commands/help.ts)_\n\n## `trudge new FILE`\n\ncreate a new migration script from a template\n\n```\nUSAGE\n  $ trudge new FILE\n\nARGUMENTS\n  FILE  path to write new script\n\nOPTIONS\n  -h, --help  show CLI help\n  --tpl=tpl   path to script template\n\nEXAMPLES\n  $ trudge new ./migrations/1.hello_world.sql\n  created fa07eb2a0b9c98b9349f8b7c0e2e23d344d55cfe\n\n  $ trudge new ./migrations/1.hello_world.sql --tpl=./migrations/new_template.sql\n  created 24dfbf1dc4f95dd849238ac5692d3e3256bf9ede\n```\n\n_See code: [src/commands/new.ts](https://github.com/numberoverzero/trudge-cli/blob/v1.0.0/src/commands/new.ts)_\n\n## `trudge sync DATABASEFILE [MIGRATIONSDIR]`\n\nattempt to synchronize the state of the database\n\n```\nUSAGE\n  $ trudge sync DATABASEFILE [MIGRATIONSDIR]\n\nARGUMENTS\n  DATABASEFILE   sqlite database file\n  MIGRATIONSDIR  [default: ./migrations/] path to the migrations directory\n\nOPTIONS\n  -U, --latest       force latest upgrade to rerun if everything is up to date\n  -f, --force        downgrade any unexpected migrations instead of aborting\n  -h, --help         show CLI help\n  -t, --table=table  [default: trudge_migrations] table name that tracks migration state\n  -v, --verbose      write verbose database to stdout\n  --log=log          file to write verbose database log\n\nEXAMPLES\n  $ trudge sync my.db\n  upgrade:001.hello_world.sql\n  upgrade:002.add_users_table.sql\n  upgrade:400.backfill_users.sql\n\n  $ trudge sync my.db\n  up to date\n\n  $ trudge sync my.db -U\n  reran upgrade:400.backfill_users.sql\n\n  $ rm migrations/2.add_users_table.sql\n  $ trudge sync my.db\n  aborting, found 1 unexpected migrations in \"my.db\"\n  002.add_users_table.sql\n\n  $ trudge new migrations/310.backfill_index.sql\n  created 4259dd3cbaf8ece27d19515ba5449615d6355472\n  $ trudge sync my.db -f\n  downgrade:002.add_users_table.sql\n  upgrade:310.backfill_index.sql\n```\n\n_See code: [src/commands/sync.ts](https://github.com/numberoverzero/trudge-cli/blob/v1.0.0/src/commands/sync.ts)_\n\n## `trudge upgrade DATABASEFILE MIGRATIONFILE`\n\napply an upgrade to the database\n\n```\nUSAGE\n  $ trudge upgrade DATABASEFILE MIGRATIONFILE\n\nARGUMENTS\n  DATABASEFILE   sqlite database file\n  MIGRATIONFILE  the migration to apply\n\nOPTIONS\n  -f, --force        force the migration to apply regardless of database state\n  -h, --help         show CLI help\n  -t, --table=table  [default: trudge_migrations] table name that tracks migration state\n  -v, --verbose      write verbose database to stdout\n  --log=log          file to write verbose database log\n\nALIASES\n  $ trudge up\n\nEXAMPLES\n  $ trudge upgrade my.db migrations/01.hello_world.sql\n  upgrade:1.hello_world.sql (a86c88c86fd3a2c0245e96294538b5c7b766697f)\n  $ trudge upgrade my.db migrations/01.hello_world.sql\n  up to date\n  $ trudge up my.db migrations/01.hello_world.sql -f\n  upgrade:1.hello_world.sql (a86c88c86fd3a2c0245e96294538b5c7b766697f)\n```\n\n_See code: [src/commands/upgrade.ts](https://github.com/numberoverzero/trudge-cli/blob/v1.0.0/src/commands/upgrade.ts)_\n\u003c!-- commandsstop --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumberoverzero%2Ftrudge-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumberoverzero%2Ftrudge-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumberoverzero%2Ftrudge-cli/lists"}