---
schema_version: "1"
id: 1c71b1f3e37df5a5b7bb24a799dbf29a33d0824bacb2714442506feb229a2a6c
title: Design Patterns
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforcedx/sfcliplugin/guides/design/patterns.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-cli-plugin/guide/patterns.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: def6ddd93a6a1b1ded8b90acf89be4ce517dc48b2c79566c7f1051f38c645cf9
products:
  - Salesforce CLI Plugin Developer Guide
  - salesforcedx
---
# Design Patterns

Use these patterns while designing your commands:

- Use the `--async` flag for events that are long running and happening on the server level rather than in the client CLI.
  - Example: `sf org create sandbox --async`
- Provide user feedback for long running commands.
- Use a spinner with interactive commands.
- Long-running commands must always provide an ID to report back on.
- Multiple resources must have a default.
- Present lists as tables.
- Use these flags when including and outputting files or directories: `--output-file`, `—output-dir`, `—input-file`, `--input-dir`.
