- 1. My custom command isn’t showing in the terminal. Why?
- 2. My command appears in help but doesn’t run.
- 3. Arguments are always empty (input.args = []).
- 4. Custom output types don’t change color.
- 5. The terminal doesn’t print anything when I run my command.
- 6. My custom command is not visible to guests. Why?
- 7. My add-on loads, but commands don’t appear in help.
- 8. Wallet commands don’t work for my extension.
- 9. Overriding commands isn’t working.
- 10. How do I debug command execution step-by-step?
- 11. My command executes twice. Why?
- 12. My add-on only works after refreshing the page.
- Summary
This article covers the most common issues developers encounter when extending the Cointacted Social Terminal, along with their solutions.
All answers are based on the real structure of your plugin.
1. My custom command isn’t showing in the terminal. Why? #
Most common reasons:
1. Your JS file is loading before the terminal. #
Fix by adding this dependency:
['cointacted-social-terminal-js']
Example:
wp_enqueue_script(
'my-ext',
plugin_dir_url(__FILE__) . 'addon.js',
['cointacted-social-terminal-js'],
'1.0',
true
);
2. The script failed to load (404). #
Open DevTools → Network → “JS” filter → check if your file loads.
3. JavaScript error prevented command registration. #
Check DevTools → Console for red errors.
4. Command registered as wrong key name. #
Command names must be:
- lowercase
- no spaces
- alphanumeric
Example valid:
getprice
Invalid:
get price
Get Price
2. My command appears in help but doesn’t run. #
The command probably:
- throws an exception, or
- uses an undefined variable, or
- returns before appending output
Wrap your command:
try {
// code
} catch (e) {
cointacted_social_terminal_append_line(String(e), "error");
}
3. Arguments are always empty (input.args = []). #
That means you’re splitting incorrectly.
Arguments work only when the user types:
command something here
Verify your code:
CointactedSocialTerminalTerminal.registry.mycmd = function(input) {
console.log(input.args);
};
If still empty:
You may be trimming or cleaning input before passing it.
Check your code for input.raw = "" or custom preprocessing.
4. Custom output types don’t change color. #
You must add CSS for custom types:
.cointacted-social-terminal__line--reward {
color: #00cc77;
font-weight: bold;
}
And use:
cointacted_social_terminal_append_line("+10 XP", "reward");
If you forget the CSS — output will still work, but look neutral.
5. The terminal doesn’t print anything when I run my command. #
Causes:
✔ You forgot to append output #
A command must call:
cointacted_social_terminal_append_line(...)
Commands do NOT print automatically.
✔ An error stopped execution #
Check console.
✔ You returned early #
For example:
return; // before printing
✔ Wrong variable name #
Using:
cointacted_social_terminal_append(...)
instead of:
cointacted_social_terminal_append_line(...)
6. My custom command is not visible to guests. Why? #
Your plugin has safe command rules.
Commands marked as unsafe:
- require login
- won’t appear to guests
- won’t run for guests
If you want a command to be public:
CointactedSocialTerminalTerminal.commands_meta.mycmd = {
public: true,
group: "TOOLS",
description: "Public custom command"
};
Never force-enable unsafe commands for guests.
7. My add-on loads, but commands don’t appear in help. #
Help lists commands only if:
- they are registered
- metadata exists
- the user has permission
- the command is not hidden
Add metadata:
CointactedSocialTerminalTerminal.commands_meta.mycmd = {
group: "TOOLS",
description: "My custom tool command."
};
8. Wallet commands don’t work for my extension. #
Possible reasons:
✔ MetaMask is locked #
✔ Browser wallet not installed #
✔ Core wallet awareness is disabled in settings #
✔ Your code executed before MetaMask injected window.ethereum #
✔ You’re calling RPC (not allowed in core — must use add-on) #
Make sure:
- You test with unlocked MetaMask
- You debug
ethereum.request()for add-on Web3 logic
9. Overriding commands isn’t working. #
To override a command, your code MUST run after the original registers.
Example:
document.addEventListener("DOMContentLoaded", function() {
CointactedSocialTerminalTerminal.registry.help = function() {
cointacted_social_terminal_append_line("Custom help!", "system");
};
});
Or ensure you enqueue your script with proper dependency:
['cointacted-social-terminal-js']
10. How do I debug command execution step-by-step? #
✔ Use console.log(input) in your command #
✔ Use DevTools → Sources to set JS breakpoints #
✔ Log all output events: #
document.addEventListener(
"cointacted_social_terminal_output",
(e) => console.log("OUT:", e.detail)
);
✔ Use the history command inside the terminal #
✔ Print debug lines using: #
cointacted_social_terminal_append_line("DEBUG", "admin");
11. My command executes twice. Why? #
Most common causes:
- The command is registered twice (same JS file loaded twice)
- You enqueued the script on both frontend + admin unnecessarily
- You used a builder that duplicates JS
Check:
In browser Network → JS #
Make sure your addon JS loads once.
12. My add-on only works after refreshing the page. #
This happens if your script loads in the footer but terminal is initialized before DOM ready.
Use:
document.addEventListener("DOMContentLoaded", function() {
// register commands here
});
Or enqueue your script in footer with dependency:
true // load in footer
Summary #
This FAQ covers the most common development issues:
✔ Commands not registering #
✔ Arguments empty #
✔ Colors not applying #
✔ Output not showing #
✔ Guest restrictions #
✔ Help not updating #
✔ Overriding failures #
✔ Wallet issues #
✔ Script loading timing #
✔ Duplicate executions #
✔ Debugging tools #
Following these fixes ensures your custom commands and add-ons behave reliably.