This guide helps you migrate your ReadMe CLI (rdme) setup to the latest version and prepare for future versions. Choose your migration path based on whether you're using ReadMe Refactored.
- If your project is using ReadMe Refactored, use
rdme@v10and beyond. - If your project is not yet using ReadMe Refactored, use
rdme@v9. Thev9channel will continue to be maintained while we focus on making sure that everybody can upgrade their ReadMe projects to ReadMe Refactored.
- Migrating to
rdme@10 - Migrating to
rdme@9 - Migrating to
rdme@8 - Version Compatibility Matrix
- Need Help?
This guide explains how to install rdme@10 for use with ReadMe Refactored. In general, we recommend bi-directional syncing for tasks like:
- Syncing Markdown files
- Syncing API definitions (and editing them visually with the API designer)
- Managing project hierarchy (e.g., versions and categories)
However rdme@10 is useful for more targeted workflows—particularly when syncing happens outside of Git, such as:
- A one-directional sync of an API definition (e.g., if it is generated via a build process and/or is not tracked via your bidirectionally synced Git repo)
- A one-directional sync of Markdown files (e.g., if they are updated via a build process and/or are not tracked via your bidirectionally synced Git repo)
- Any non-syncing processing for an API definition (e.g., validating it, reducing it a set of fewer operations)
Note
rdme@10 only works with ReadMe projects that are using ReadMe Refactored. If you are not yet using ReadMe Refactored, you'll want to use rdme@9.
If you're using the rdme CLI and it is installed globally via npm, update it by running the following command:
npm install -g rdme@10More installation options can be found in our docs.
If you're using the rdme GitHub Action, update your GitHub Actions workflow file so your rdme usage uses the v10 reference like so:
- uses: readmeio/rdme@v10
with:
rdme: openapi validate petstore.json-
Enable Bi-Directional Syncing (recommended)
We recommend setting up bi-directional syncing for managing your Markdown files, API definitions and project hierarchy.
- Command Replacements
- Replace:
changelogs→changelog upload(see more in step 3 below) - Replace:
custompages→custompages upload(see more in step 3 below) - Replace:
docs(and itsguidesalias) →docs upload(see more in step 3 below)- Note: if you previously used this command to upload Markdown to the API reference section, you should use
rdme reference uploadinstead. See more in step 3 below.
- Note: if you previously used this command to upload Markdown to the API reference section, you should use
- Replace:
openapi→openapi upload(see more in step 4 below) - Replace:
categories→ use Git-based workflow - Replace:
versions→ use Git-based workflow - Remove:
open
- Replace:
-
Updates to Markdown uploading commands
If you previously uploaded Markdown files to your ReadMe project via one of the following commands:
rdme docs,rdme changelogsrdme custompages(note: this command also supports the uploading of HTML files)
The commands have been updated to the following:
rdme docs upload(orrdme reference uploadif you're uploading Markdown to your API Reference section)rdme changelog uploadrdme custompages upload(note: this new command still supports the uploading of HTML files)
The command semantics are largely the same, but with a few small changes:
-
The
--dryRunflag has been deprecated in favor of--dry-run. -
The new git-backed ReadMe backend has a clearer separation between the Guides and API reference sections. This means that:
- Markdown pages that live in the Guides section should be synced with
rdme docs upload - Conversely, Markdown pages that live in the API reference should be synced with
rdme reference upload.
- Markdown pages that live in the Guides section should be synced with
-
There is no prompt to select your ReadMe project version if you omit the
--versionflag. It now defaults tostable(i.e., your main ReadMe project version). This flag has also been renamed to--branch. -
These commands will now automatically validate your frontmatter and flag any issues prior to syncing. This is particularly helpful if you're coming from
rdme@9or earlier, since the shape of certain frontmatter attributes (e.g.,category,parent,hidden) have slightly changed. If you run this command in a non-CI environment, any outdated frontmatter will be detected and you'll have the ability to migrate it to the new format automatically.
Read more in the respective command docs (
rdme docs upload,rdme reference upload,rdme changelog upload,rdme custompages upload) and in the ReadMe API migration guide.
-
openapihas been replaced byopenapi uploadIf you previously uploaded API definitions to ReadMe via
rdme openapi, the command is nowrdme openapi upload. There are now two main updates:-
Like the Markdown uploading commands above, there is no prompt to select your ReadMe project version if you omit the
--versionflag. It now defaults tostable(i.e., your main ReadMe project version). This flag has also been renamed to--branch. -
The flag paradigms have been simplified based on community feedback. With the previous command, the
--idflag was a hexadecimal object ID (e.g.,687855c3600c6e14c79a94cb). These IDs lacked readability and required an initial upload to ReadMe to obtain, which made it difficult to upsert API definitions and manage many at scale. Withopenapi uploadand ReadMe Refactored, the--idflag has been removed in favor of--slug. Slugs are now the unique identifier for an API definition resource in ReadMe.Unlike the object ID paradigm that was previously used with
--id, the--slugflag enables you to define a slug during initial upload. While we encourage you to use this flag and especially encourage slugs that are human-readable and descriptive,--slugis technically optional. When omitted, your API definition's slug is inferred from the file path or URL to your API definition.If you've migrated your project from our legacy platform and you'd like to continue syncing any previously uploaded API definitions via
rdme, we recommend either 1) looking at the post-migration file name in ReadMe and using the--slugflag to refer to that (recommended!) or 2) passing the legacy object ID reference via the--legacy-idflag (this is a hidden flag and should not be used in new workflows).
Read more in the
rdme openapi uploadcommand docs and in the ReadMe API migration guide. -
This release adds a few features that make it even easier to get started with rdme:
-
Enhanced Command Documentation
- Complete command reference in the
documentation/commandsdirectory - Command reference pages are split out by topic for intuitive organization and ease of access
- Each command reference contains detailed usage examples and parameter descriptions
- Complete command reference in the
-
Improved CLI Experience
- Overhauled help screens with detailed examples to improve readability and ease of use
- Set up CLI autocompletions with the
autocompletecommand - Smart command discovery that helps catch and correct typos
- Redesigned error messages with clear resolution steps
Note
rdme@9 only works with ReadMe projects that are not using ReadMe Refactored. If you are using ReadMe Refactored, you'll want to use rdme@10.
If you're using the rdme CLI and it is installed globally via npm, update it by running the following command:
npm install -g rdme@9More installation options can be found in our docs.
If you're using the rdme GitHub Action, update your GitHub Actions workflow file so your rdme usage uses the v9 reference like so:
- uses: readmeio/rdme@v9
with:
rdme: openapi validate petstore.json-
Verify your runtime
- For CLI users, make sure your Node.js version is up-to-date. The minimum required Node.js version for
rdme@9is v20.10.0. - The
rdmerelease process is no longer publishing Docker images and the GitHub Action is now a JavaScript action. This change should not affect any GitHub Actions users.
- For CLI users, make sure your Node.js version is up-to-date. The minimum required Node.js version for
-
Topic separator changes
- The topic separator (i.e., what separates a command from its subcommand) has changed from a colon to a space by default. For example,
rdme openapi:validateis nowrdme openapi validate. - The colon topic separator will continue to be supported so this is not a breaking change in terms of the CLI itself, but all documentation and help screens will reflect the space topic separator going forward.
- The topic separator (i.e., what separates a command from its subcommand) has changed from a colon to a space by default. For example,
-
Command replacements
- Replace
swagger→openapi - Replace
validate→openapi validate - Remove:
docs:edit,oas
- Replace
-
Version flag updates
The CLI flags on the
versions createandversions updatecommands now maintain parity with our API flags. The--isPublicflag has been removed in favor of a new flag called--hidden, which is the inverse of--isPublic.Before
rdme versions:create 1.0.1 --isPublic trueAfter
rdme versions create 1.0.1 --hidden false -
Deprecated commands
The following commands (and their subcommands, if applicable) will be removed in
rdme@10:categoriesdocs:prune(and itsguides:prunealias)versionsopen
The following commands will be replaced in
v10. See "Command Replacements" in thev10migration guide above for more info:docs(and itsguidesalias) →docs uploadfor the Guides section (orreference uploadif uploading Markdown to your API reference section)changelogs→changelog uploadcustompages→custompages uploadopenapi→openapi upload
-
Verify any scripts that utilize raw CLI outputs
- The underlying architecture for the CLI has been rewritten with
oclif, so some command outputs and error messages may look different. - With the exception of the
--rawflag onopenapi, we recommend relying on CLI exit codes in your workflows rather than raw command outputs.
- The underlying architecture for the CLI has been rewritten with
Please see the rdme@8.0.0 release notes.
Warning
rdme@8 is deprecated and is no longer maintained. If your project has not upgraded to ReadMe Refactored, we still recommend upgrading to rdme@9 to ensure that your CLI installation remains free of security vulnerabilities. rdme@9 should be a fairly painless upgrade for most users. More information can be found in the version compatibility matrix below.
| Feature | v8 |
v9 |
v10 |
|---|---|---|---|
| Actively Maintained? | ❌ | ✅ | ✅ |
| Support for ReadMe Refactored* | ❌ | ❌ | ✅ |
| Supports Bi-Directional Sync | ❌ | ❌ | ✅ |
| Support for Legacy Projects (i.e., not yet migrated to ReadMe Refactored) | ✅ | ✅ | ❌ |
| Node.js Requirements | >=14 |
>=20.10.0 |
>=20.10.0 |
*If you uploaded an API definition prior to migrating your project to ReadMe Refactored, any existing workflows for syncing these files that use a legacy rdme version (i.e., v9 or earlier) should continue to work, even after migrating. For new workflows, we recommend following this migration guide and upgrading to the latest version.
If you notice any issues or disruptions to your workflow during migration, we're here to help! Feel free to...
- Open up an issue on GitHub 🆘
- Get in touch with us at support@readme.io 📬
- Say hi on Slack 👋