<- Back to all posts

What’s New in Ditto CLI v4.0.0

Jessica Ouyang
|
September 5, 2023

The Ditto CLI utilizes our API to keep string files in development up-to-date — without leaving your command line.

You can use our CLI to fetch down the latest text, already formatted for everything from localization to variable interpolation to pluralization, from JSON to iOS Strings to XML. Additionally, teams frequently use the Ditto CLI in CI pipelines to automate the fetching of text.

Last week, we released v4.0.0 of our CLI, with a focus on flexibility. We wanted to showcase two key CLI features new to this version and how you can utilize them.

Source-specific Config Flags

In CLI config, you can now specify flags for each source you’re pulling from (project or component folder). This means you can specify a flag like status specific to each source.

For example, with a status flag:


sources:
  components:
    root:
      # for "root level" components (not in folders)
      status: WIP
    folders:
      - id: folder-id
        name: Folder 1
        # for individual component folders
        status: FINAL
  projects:
    - id: project-id-1
      name: Project 1
      # for individual projects
      status: REVIEW
      exclude_components: true
  # at the root level
  status: FINAL

Folder-specific String Files

Previously, component sources specified in the config filtered served as filters to a single component library file (or several component library variant files). In v4.0.0, component sources pull down into their own files.


# Before
ditto_component_library__base.json
ditto_component_library__spanish.json

# After
components__root__base.json
components__root__spanish.json
components__some-folder__base.json
components__some-folder__spanish.json

We’re excited to introduce these updates to help teams building out robust component libraries to manage their text. Increasingly, we’ve seen teams utilize component folders to own the strings of different product areas — in addition to pulling down text into different relevant directories.

We hope the newest version helps teams continue to robustly and flexibly use Ditto to handle all of their product text.

Getting Started

Want to try out the CLI to fetch down text from your Ditto workspace? Check out these resources:

  • Download our CLI via npm: "npm i --save-dev @dittowords/cli" (adds as a developer dependency)
  • Check out our developer docs for guidance and sample projects
  • Have any other feature requests? Open an issue in the CLI’s Github Repo

Success! 🥳 Look forward to Ditto updates in your inbox.
Oh no — something went wrong while submitting the form. Please try again!