Skip to content

Commit d5c0c88

Browse files
strickvlclaude
andcommitted
refactor: keep --app-name flag as non-deprecated for {{app}} placeholder
Remove deprecation from --app-name since it serves a valuable purpose for the {{app}} placeholder in custom strings, especially useful for internationalization. Update documentation to show how --app-name works with --custom-strings and clarify that only --welcome-text is deprecated. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 27ee714 commit d5c0c88

File tree

3 files changed

+38
-21
lines changed

3 files changed

+38
-21
lines changed

docs/customization.md

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -95,40 +95,58 @@ docker run -it --name code-server -p 127.0.0.1:8080:8080 \
9595
}'
9696
```
9797

98-
## Legacy Support (Deprecated)
98+
## Using App Name with Custom Strings
9999

100-
The following flags are still supported but deprecated. Use `--custom-strings` for new deployments:
100+
The `--app-name` flag works perfectly with `--custom-strings` to provide the `{{app}}` placeholder functionality:
101101

102102
```bash
103-
# Deprecated - use --custom-strings instead
104103
code-server \
105-
--app-name "My Development Server" \
106-
--welcome-text "Welcome to the development environment"
104+
--app-name "Dev Portal" \
105+
--custom-strings '{"WELCOME": "Welcome to {{app}} environment"}'
107106
```
108107

109-
These legacy flags will show deprecation warnings and may be removed in future versions.
108+
This approach allows you to:
109+
- Set a custom app name once with `--app-name`
110+
- Use `{{app}}` placeholders in your custom strings
111+
- Easily change the app name without updating all strings
110112

111-
## Migration Guide
113+
### Examples with App Name
112114

113-
### From Legacy Flags to Custom Strings
115+
**Corporate branding with dynamic app name:**
116+
```bash
117+
code-server \
118+
--app-name "ACME Development Platform" \
119+
--custom-strings '{
120+
"WELCOME": "Welcome to {{app}}",
121+
"LOGIN_TITLE": "{{app}} Access Portal",
122+
"LOGIN_BELOW": "Please authenticate to access {{app}}"
123+
}'
124+
```
114125

115-
**Old approach:**
126+
**Internationalization with app name:**
116127
```bash
117128
code-server \
118-
--app-name "Dev Portal" \
119-
--welcome-text "Welcome to development"
129+
--app-name "Mon Portail" \
130+
--custom-strings '{
131+
"WELCOME": "Bienvenue sur {{app}}",
132+
"LOGIN_TITLE": "Connexion à {{app}}",
133+
"SUBMIT": "SE CONNECTER"
134+
}'
120135
```
121136

122-
**New approach:**
137+
## Legacy Flag Migration
138+
139+
The `--welcome-text` flag is deprecated. Migrate to `--custom-strings`:
140+
141+
**Old:**
123142
```bash
124-
code-server --custom-strings '{
125-
"WELCOME": "Welcome to development"
126-
}'
143+
code-server --welcome-text "Welcome to development"
127144
```
128145

129-
**Note:** The `--app-name` flag controls the `{{app}}` placeholder in templates. You can either:
130-
1. Keep using `--app-name` alongside `--custom-strings`
131-
2. Customize the full text without placeholders in your JSON
146+
**New:**
147+
```bash
148+
code-server --custom-strings '{"WELCOME": "Welcome to development"}'
149+
```
132150

133151
## Benefits of Custom Strings
134152

src/node/cli.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,7 @@ export const options: Options<Required<UserProvidedArgs>> = {
285285
"app-name": {
286286
type: "string",
287287
short: "an",
288-
description: "The name to use in branding. Will be shown in titlebar and welcome message",
289-
deprecated: true,
288+
description: "Will replace the {{app}} placeholder in any strings, which by default includes the title bar and welcome message",
290289
},
291290
"welcome-text": {
292291
type: "string",

test/unit/node/cli.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ describe("parser", () => {
366366
expect(() => parse(["--custom-strings", "/path/to/file.json"])).not.toThrow()
367367
})
368368

369-
it("should support deprecated app-name and welcome-text flags", async () => {
369+
it("should support app-name and deprecated welcome-text flags", async () => {
370370
const args = parse(["--app-name", "My App", "--welcome-text", "Welcome!"])
371371
expect(args).toEqual({
372372
"app-name": "My App",

0 commit comments

Comments
 (0)