Shell
Shell Command Formatter
Convert long Bash and shell commands between single-line and readable multi-line formats, without fixing line continuations by hand. Paste a command. Format it. Copy it. Done.
Single LineMulti Line
Single line → multi line
docker run --rm -p 8080:8080 -e APP_ENV=production -e LOG_LEVEL=info myapp:latest
docker run --rm \ -p 8080:8080 \ -e APP_ENV=production \ -e LOG_LEVEL=info \ myapp:latest
Multi line → single line
kubectl create deployment myapp \ --image=mycompany/myapp:latest \ --replicas=3 \ --namespace=production
kubectl create deployment myapp --image=mycompany/myapp:latest --replicas=3 --namespace=production
Use multi-line mode when readability matters. Use single-line mode when you just want to paste the command into a terminal.
Make long shell commands readable
Long commands are great for terminals but terrible for documentation. Multi-line commands are easier to read, review and edit, but they can be frustrating to copy and paste, because every line has to end with the right continuation character. DocuFormat lets you switch between the two instantly.
Turning a Bash command from a single line into multiple lines puts each option on its own row, so you can see what a Docker, kubectl or AWS CLI call is actually doing. Going the other way, you can convert a shell command to one line and paste it straight into a terminal, a script or a chat message with no stray backslashes.
Whether you call it formatting, pretty-printing or beautifying a command, the result is the same command, laid out for the place you are about to use it.
Built for developer copy and paste
Commands rarely stay in one place. You find them in one environment and need them in another, and a layout that works in one is often awkward in the next:
- Documentation → Terminal
- Terminal → Documentation
- Slack → Terminal
- GitHub → Terminal
- AI assistant → Terminal
- Terminal → Support ticket
The usual fix is manual cleanup: adding or deleting backslashes, rejoining lines, hoping nothing was lost. DocuFormat removes that step.
- Paste
- Format
- Copy
Common sources include READMEs, Stack Overflow answers, cloud documentation, CI/CD configuration and your own terminal history. It is designed for everyday developer commands such as Docker, kubectl, AWS CLI, Git, npm, Maven, Java, SSH, grep, find and cURL.
More than line wrapping
A formatter that only inserts a newline every eighty characters will happily cut a quoted string in half. DocuFormat is meant to understand how a shell command is structured, so it breaks the command at argument and option boundaries instead. Where supported, formatting preserves:
- arguments and options
- quoted strings
- environment variables
- pipes and redirects
- command chaining
- shell escaping
The aim is simple: formatting should improve readability without changing what the command means. As with any tool that rewrites a command, read it over before you run it, especially when it involves unusual quoting or escaping.
docker run \ --name myapp \ --restart unless-stopped \ -p 8080:8080 \ -e APP_ENV=production \ mycompany/myapp:latest
Shell formatting meets cURL intelligence
cURL commands are shell commands, but DocuFormat can understand them at a deeper level. For ordinary shell commands it cleans up the presentation. For cURL it can also identify the HTTP method, URL, headers, request body and authentication, which is what the cURL formatter and cURL parser show.
- Shell formatter
- cURL detected
- Method
- URL
- Headers
- Body
That is the difference between treating a command as generic text and treating it as developer input.
Format the command. Format the data inside it.
A cURL command often carries a JSON body squashed into one quoted string. DocuFormat’s cURL formatter lays out the command and pretty-prints the JSON inside it. Here is a real example:
curl -X POST https://api.example.com/users -H "Content-Type: application/json" -d '{"name":"Steve","active":true}'
curl \ https://api.example.com/users \ -H 'Content-Type: application/json' \ --data-raw '{ "name": "Steve", "active": true}'
Notice that the explicit -X POST is dropped because a request body already implies POST; the method is still shown in the cURL Request view. More in the cURL command formatter guide.
Broken shell command?
Formatting helps when a command is valid. When quoting, escaping, continuations or syntax are broken, DocuFormat’s optional AI Fix can help identify the problem and propose a corrected command. Typical problems include:
- broken or unbalanced quotes
- bad escaping
- incorrect line continuations
- malformed cURL
- damaged commands copied from documentation
AI Fix is optional and only runs when you click it. Your command is not sent to an AI provider before that, you confirm the first time, and the suggestion is a proposal you review, not something applied automatically. See how AI Fix works.
Understand before you run
Some commands are hard to read even when they are tidy. Explain describes a complicated command in plain language, covering its commands, arguments, options, pipes and redirects, and for commands that contain potentially destructive operations the explanation should make that obvious.
find . -type f -name "*.log" -mtime +7 -print0 | xargs -0 rm
Illustrative explanation, generated only when you click Explain: finds regular files named *.log under the current directory that were modified more than 7 days ago, and pipes their names to rm, which deletes them.
The command is analysed as text. DocuFormat does not execute or test it.
DocuFormat formats shell commands. It does not execute them.
Shell commands can contain API tokens, passwords, private URLs, authentication headers, environment variables and infrastructure details. So routine formatting is meant to be deterministic and to need no AI, and a command is only sent to an AI provider after you explicitly choose an AI feature.
- Shell commands are treated as data and are never executed.
- SQL is never executed.
- cURL requests are never executed.
Secrets are not redacted for you, so remove real credentials before using an AI action. Details are on the privacy page.
Questions, answered
How do I convert a bash command to one line?
Paste the multi-line command and choose single-line output. DocuFormat joins the lines and removes the line continuations, so you can paste the result straight into a terminal.
How do I format a long shell command?
Paste it and choose multi-line output. DocuFormat breaks the command at argument and option boundaries and adds the continuation characters for you.
Does DocuFormat run my command?
No. Shell commands are formatted as text and are never executed.
Will formatting change what my command does?
The goal is that formatting changes only layout, not meaning. It is still sensible to read a rewritten command before you run it, particularly if it uses complicated quoting or escaping.
Which commands does it work with?
It is designed for everyday developer commands such as Docker, kubectl, AWS CLI, Git, npm, Maven, Java, SSH, grep, find and cURL.
Is my command sent to an AI?
Not for formatting. A command is only sent to an AI provider if you click AI Fix or Explain.
Does it work for cURL?
Yes, and cURL gets extra treatment: DocuFormat can identify the method, URL, headers, body and authentication. See the cURL formatter.