Skip to content

Commit 5722a9a

Browse files
committed
refactor: update command names and descriptions for clarity and consistency
1 parent c4ec90c commit 5722a9a

13 files changed

+55
-100
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Fluent (ServiceNow SDK) MCP bridges ServiceNow development tools with modern AI-
88

99
Key capabilities include:
1010

11-
- All ServiceNow SDK CLI commands: `version`, `help`, `debug`, `upgrade`, `auth`, `init`, `build`, `install`, `transform`, `dependencies`
12-
- ServiceNow authentication via `@servicenow/sdk auth --add <instance>`
11+
- All ServiceNow SDK CLI commands: `version`, `help`, `auth`, `init`, `build`, `install`, `upgrade`, `dependencies`, `transform`
12+
- ServiceNow instance authentication via `npx now-sdk auth --add <instance>`
1313
- API specifications for metadata types like `acl`, `business-rule`, `client-script`, `table`, `ui-action` and more
1414
- Code snippets and examples for different metadata types
1515
- Instructions for creating and modifying metadata types
@@ -30,7 +30,6 @@ Note: Use `init` command to switch to a working directory for existing Fluent pr
3030
| -------------- | --------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
3131
| `version` | Get ServiceNow SDK version information | None |
3232
| `help` | Get help information about ServiceNow SDK commands | `command`: (Optional) The specific command to get help for |
33-
| `debug` | Enable debug mode for ServiceNow SDK commands | `command`: The command to run with debug mode enabled |
3433
| `upgrade` | Upgrade ServiceNow SDK to the latest version | `check`: (Optional) Only check for updates without upgrading, `debug`: (Optional) Enable debug - **disabled for now** |
3534
| `auth` | Authenticate to a ServiceNow instance | `add`: (Optional) Instance URL to add, `type`: (Optional) Authentication method, `alias`: (Optional) Alias for the instance |
3635
| `init` | Initialize a new ServiceNow application | `from`: (Optional) sys_id or path, `appName`: App name, `packageName`: Package name, `scopeName`: Scope name, `auth`: (Optional) Authentication alias |

src/tools/commands/authCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import { SessionFallbackCommand } from './sessionFallbackCommand.js';
88
* Handles adding, listing, deleting, and selecting auth profiles
99
*/
1010
export class AuthCommand extends SessionFallbackCommand {
11-
name = 'prepare_fluent_auth';
12-
description = 'Generate shell command to manage Fluent (ServiceNow SDK) authentication to <instance_url> with credential profiles, including create new auth alias, list /show existing ones, delete or use an existing one';
11+
name = 'manage_fluent_auth';
12+
description = 'Manage Fluent (ServiceNow SDK) authentication to instance with credential profiles, use this to add, list, delete, or switch between authentication profiles';
1313
arguments: CommandArgument[] = [
1414
{
1515
name: 'add',

src/tools/commands/buildCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { SessionAwareCLICommand } from './sessionAwareCommand.js';
66
* Uses the session's working directory
77
*/
88
export class BuildCommand extends SessionAwareCLICommand {
9-
name = 'fluent_build';
10-
description = "Build the Fluent (ServiceNow SDK) application in the current session's working directory";
9+
name = 'build_fluent_app';
10+
description = 'Build the Fluent (ServiceNow SDK) application located in the current working directory.';
1111
arguments: CommandArgument[] = [
1212
{
1313
name: 'debug',

src/tools/commands/dependenciesCommand.ts

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,9 @@ import { SessionAwareCLICommand } from './sessionAwareCommand.js';
66
* Uses the session's working directory
77
*/
88
export class DependenciesCommand extends SessionAwareCLICommand {
9-
name = 'fluent_dependencies';
10-
description = "Manage dependencies for the Fluent (ServiceNow SDK) application in the current session's working directory";
9+
name = 'download_fluent_dependencies';
10+
description = 'Download configured dependencies in now.config.json and TypeScript type definitions for use in the application';
1111
arguments: CommandArgument[] = [
12-
{
13-
name: 'add',
14-
type: 'boolean',
15-
required: false,
16-
description: 'Add dependencies',
17-
},
18-
{
19-
name: 'install',
20-
type: 'boolean',
21-
required: false,
22-
description: 'Install dependencies',
23-
},
24-
{
25-
name: 'list',
26-
type: 'boolean',
27-
required: false,
28-
description: 'List dependencies',
29-
},
30-
{
31-
name: 'packageName',
32-
type: 'string',
33-
required: false,
34-
description: 'Name of the package to add',
35-
},
3612
{
3713
name: 'auth',
3814
type: 'string',
@@ -51,23 +27,10 @@ export class DependenciesCommand extends SessionAwareCLICommand {
5127
const sdkArgs = ['now-sdk', 'dependencies'];
5228

5329
// Add optional arguments if provided
54-
if (args.add) {
55-
sdkArgs.push('--add');
56-
57-
if (args.packageName) {
58-
sdkArgs.push(args.packageName as string);
59-
}
60-
} else if (args.install) {
61-
sdkArgs.push('--install');
62-
} else if (args.list) {
63-
sdkArgs.push('--list');
64-
}
65-
6630
if (args.auth) {
6731
sdkArgs.push('--auth', args.auth as string);
6832
}
6933

70-
// Add debug flag if specified
7134
if (args.debug) {
7235
sdkArgs.push('--debug');
7336
}

src/tools/commands/helpCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { SessionFallbackCommand } from './sessionFallbackCommand.js';
77
*/
88
export class HelpCommand extends SessionFallbackCommand {
99
name = 'get_fluent_help';
10-
description = 'Get help information about Fluent (ServiceNow SDK) commands';
10+
description = 'Provides help and usage information for any Fluent (ServiceNow SDK) command.';
1111
arguments: CommandArgument[] = [
1212
{
1313
name: 'command',

src/tools/commands/initCommand.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,44 +13,44 @@ import logger from '../../utils/logger.js';
1313
* Implements the init command with validation of prerequisites
1414
*/
1515
export class InitCommand extends BaseCLICommand {
16-
name = 'prepare_fluent_init';
17-
description = "Generate the Shell command to initialize a Fluent (ServiceNow SDK) application: If specified working directory has no Fluent (ServiceNow SDK) application, it will create a new one. If it has a Fluent (ServiceNow SDK) application, it will save the directory as the working directory for future commands, including build, install, transform and dependencies.\nWhen converting an existing ServiceNow application, use the 'from' argument to specify the system ID or path to initialize from. \nNote, if the specified directory has no package-lock.json file, run `npm install` first.\nNote, This command will not execute the initialization but prepare the shell command to be run later.";
16+
name = 'init_fluent_app';
17+
description = 'Initialize a new ServiceNow custom application or convert a legacy ServiceNow application from an instance or directory within the current directory';
1818
arguments: CommandArgument[] = [
1919
{
2020
name: 'from',
2121
type: 'string',
2222
required: false,
23-
description: 'convert existing scoped app to Fluent by sys_id or path to initialize from',
23+
description: 'convert existing scoped app to Fluent by sys_id or file path to initialize from',
2424
},
2525
{
2626
name: 'appName',
2727
type: 'string',
2828
required: true,
29-
description: 'The name of the application, this is the user friendly name that will be displayed in ServiceNow UI.',
29+
description: 'The name of the application.',
3030
},
3131
{
3232
name: 'packageName',
3333
type: 'string',
3434
required: true,
35-
description: "The NPM package name for the application, usually it's the snake-case of appName in lowercase.",
35+
description: "The NPM package name for the application, usually it's the snake-case of appName in lowercase with company prefix.",
3636
},
3737
{
3838
name: 'scopeName',
3939
type: 'string',
4040
required: true,
41-
description: "The scope name for the application in <prefix>_<scope_name> format. For localhost development, it should be in the format of 'sn_<scope_name>'. This is required to create a new Fluent (ServiceNow SDK) application, no spaces allowed.",
41+
description: "The scope name for the application in <prefix>_<scope_name> format. For localhost development, it should be in the format of 'sn_<scope_name>'. No spaces allowed, no greater than 18 characters.",
4242
},
4343
{
4444
name: 'auth',
4545
type: 'string',
4646
required: false,
47-
description: "The authentication alias to use. If not provided, the default authentication alias will be used. You can set up authentication using the 'auth' command.",
47+
description: "The authentication alias to use. If not provided, the default authentication alias will be used. You can set up authentication using the 'manage_fluent_auth' tool.",
4848
},
4949
{
5050
name: 'workingDirectory',
5151
type: 'string',
5252
required: false,
53-
description: "The directory where the Fluent (ServiceNow SDK) application will be created. If not provided, a new directory will be created in the user's home directory.",
53+
description: "The directory where the Fluent (ServiceNow SDK) application will be created. If not provided, a new directory will be created in the project root if exists or the user's home directory.",
5454
},
5555
{
5656
name: 'debug',

src/tools/commands/installCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { SessionAwareCLICommand } from './sessionAwareCommand.js';
66
* Uses the session's working directory
77
*/
88
export class InstallCommand extends SessionAwareCLICommand {
9-
name = 'install_fluent_app';
10-
description = "Install / Deploy the Fluent (ServiceNow SDK) application in the current session's working directory to a ServiceNow instance";
9+
name = 'deploy_fluent_app';
10+
description = 'Deploy the Fluent (ServiceNow SDK) application to a ServiceNow instance by auth alias or default auth';
1111
arguments: CommandArgument[] = [
1212
{
1313
name: 'auth',

src/tools/commands/transformCommand.ts

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,25 @@ import { SessionAwareCLICommand } from './sessionAwareCommand.js';
77
*/
88
export class TransformCommand extends SessionAwareCLICommand {
99
name = 'fluent_transform';
10-
description = "Transform files in the Fluent (ServiceNow SDK) application in the current session's working directory";
10+
description = 'Download and convert XML records from instance or from a local path into Fluent source code';
1111
arguments: CommandArgument[] = [
1212
{
13-
name: 'source',
13+
name: 'from',
1414
type: 'string',
1515
required: false,
16-
description: 'Source file or directory to transform',
16+
description: 'Path to local XML file(s)/directory to transform',
1717
},
1818
{
19-
name: 'destination',
19+
name: 'directory',
2020
type: 'string',
2121
required: false,
22-
description: 'Destination file or directory for transformed output',
22+
description: 'Path to "package.json", default to current working directory',
23+
},
24+
{
25+
name: 'preview',
26+
type: 'boolean',
27+
required: false,
28+
description: 'Preview fluent output and any transform errors without saving, default false',
2329
},
2430
{
2531
name: 'debug',
@@ -33,14 +39,17 @@ export class TransformCommand extends SessionAwareCLICommand {
3339
const sdkArgs = ['now-sdk', 'transform'];
3440

3541
// Add optional arguments if provided
36-
if (args.source) {
37-
sdkArgs.push('--source', args.source as string);
42+
if (args.from) {
43+
sdkArgs.push('--from', args.from as string);
3844
}
3945

40-
if (args.destination) {
41-
sdkArgs.push('--destination', args.destination as string);
46+
if (args.directory) {
47+
sdkArgs.push('--directory', args.directory as string);
4248
}
4349

50+
if (args.preview) {
51+
sdkArgs.push('--preview', args.preview as string);
52+
}
4453
// Add debug flag if specified
4554
if (args.debug) {
4655
sdkArgs.push('--debug');

src/tools/commands/versionCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { SessionFallbackCommand } from './sessionFallbackCommand.js';
66
*/
77
export class VersionCommand extends SessionFallbackCommand {
88
name = 'get_fluent_version';
9-
description = 'Get Fluent (ServiceNow SDK) version information';
9+
description = 'Retrieves the version number of the installed Fluent (ServiceNow SDK)';
1010
arguments: CommandArgument[] = [];
1111

1212
constructor(commandProcessor: CommandProcessor) {

src/tools/resourceTools.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export abstract class BaseResourceCommand implements CLICommand {
113113
*/
114114
export class GetApiSpecCommand extends BaseResourceCommand {
115115
name = 'get-api-spec';
116-
description = 'Get API specification for a ServiceNow metadata type';
116+
description = 'Fetches the Fluent API specification for a given ServiceNow metadata type (e.g., "business-rule", "acl", etc.).';
117117
resourceType = ResourceType.SPEC;
118118
}
119119

@@ -122,7 +122,7 @@ export class GetApiSpecCommand extends BaseResourceCommand {
122122
*/
123123
export class GetSnippetCommand extends BaseResourceCommand {
124124
name = 'get-snippet';
125-
description = 'Get code snippet for a ServiceNow metadata type';
125+
description = 'Fetches the Fluent code snippet for a given ServiceNow metadata type';
126126
resourceType = ResourceType.SNIPPET;
127127

128128
/**
@@ -200,7 +200,7 @@ export class GetSnippetCommand extends BaseResourceCommand {
200200
*/
201201
export class GetInstructCommand extends BaseResourceCommand {
202202
name = 'get-instruct';
203-
description = 'Get instructions for a ServiceNow metadata type';
203+
description = 'Retrieves instructions of Fluent API usage for a given ServiceNow metadata type';
204204
resourceType = ResourceType.INSTRUCT;
205205
}
206206

@@ -209,7 +209,7 @@ export class GetInstructCommand extends BaseResourceCommand {
209209
*/
210210
export class ListMetadataTypesCommand implements CLICommand {
211211
name = 'list-metadata-types';
212-
description = 'List all available ServiceNow metadata types';
212+
description = 'List all available ServiceNow metadata types that currently supported by Fluent (ServiceNow SDK)';
213213
arguments: CommandArgument[] = [];
214214

215215
private resourceLoader: ResourceLoader;

0 commit comments

Comments
 (0)